The early history of Portugal is shared with the rest of the Iberian peninsula. The region is visited by Phoenicians and Carthaginians, settled by Celts, incorporated in the Roman empire (as Lusitania in 138 BC), settled again by Visigoths and conquered by Muslims.

During the centuries of the Reconquest, the region has the status of a county. The count of Portugal, owing allegiance to the king of Leon, is on the Atlantic front in the unending struggle against the Muslims. His Christian duty and his own interests coincide in an urge to extend his frontier southwards.

A victory over the Muslims at Ourique in 1139 is traditionally taken as the occasion when Portugal is transformed from a county into a kingdom. In the story the exultant soldiers proclaim their count, Afonso Henriques, as king. He begins calling himself Afonso I of Portugal.

Reality is less abrupt than in the story, but the transformation does occur during the reign of Afonso Henriques. By 1143 his independence is accepted by his cousin and feudal overlord, the king of Leon. In 1179 the new kingdom is formally acknowledged by the pope.

Reconquest: 1064-1249

The city of Coimbra, used as their capital by Afonso I and his immediate successors, has been securely in Christian hands since 1064. But an even more significant recovery is made during Afonso's own reign. In 1147 he is poised to attack Lisbon on the great inlet of the river Tagus. For this assault he requires naval strength. He finds it in an unexpected quarter.

The pope has been preaching a new crusade to the Holy Land, and a fleet bearing English warriors - together with some from Flanders - sets sail from northern Europe in the late spring of 1147. In June bad weather forces them to shelter in Portugal.

It is immediately pointed out to them that they need not travel all the way to the Holy Land to kill Muslims. They can do so more easily here, and win land for themselves too. The crusaders and their ships are diverted into besieging Lisbon.

After four months of fierce hostilities, the Muslims in the city surrender on a promise that their lives are safe. The crusaders, as often elsewhere when a city of infidels falls to them, break their word and indulge in a general massacre.

Some of the crusaders continue on eastwards, but the majority settle in this new extension of the Portuguese kingdom. An English priest, Gilbert of Hastings, becomes bishop of the recovered see of Lisbon. These events of 1147 are the first of many links between England and Portugal.

The reconquest of Portugal, down to the southern coast of the Iberian peninsula, is completed in 1249 with the capture of Faro. In 1256 the capital of the kingdom is transferred from Coimbra to Lisbon. Two centuries later Lisbon's superb natural harbour is the launching point for Europe's new era of maritime exploration. By then the throne belongs to a new dynasty, the house of Avis.

John I and the house of Avis: 1385-1433

The seizing of the throne by John I lies at the start of two centuries of outstanding Portuguese achievement. He is brought to power on the crest of a wave of national sentiment, resisting domination by neighbouring Castile.

John is an illegitimate son of the previous king, Ferdinand, who dies in 1383. Ferdinand's daughter, Beatriz, is married to the king of Castile - so it is expected that the two crowns will now be merged. Instead John mounts a revolution which brings two years of humiliation for the Castilians. Lisbon withstands a five-month siege from their forces in 1384. The climax of the campaign is a Portuguese victory in 1385.

The great Dominican abbey known variously as Batalha ('battle') or Santa Maria da Vitória ('St Mary of Victory') is the triumphal celebration of the battle of 1385, fought nearby at Aljubarrota, which secures the kingdom of Portugal for John I. The victory hastens the end of the war against his Castilian rival, four months after John has himself been acclaimed king by the Cortes in Coimbra.

As a child of seven, John was appointed master of the Order of St Benedict of Avis, a Portuguese order of knights founded in the 12th century in the spirit of crusade against the Muslims. From this appointment the new dynasty is known as the House of Avis.

The founder's chapel at Batalha contains the tomb of John I himself, together with those of his wife Philippa of Lancaster and of his son Prince Henry the Navigator.

An English wife and a son with an interest in navigation - the two themes are central to the era now beginning in Portugal.

The English connection:1371-1387

A link between England and Portugal goes back to the recapture of Lisbon in 1147, but it becomes particularly strong in the late 14th century - largely through the activities of John of Gaunt.

Gaunt's involvement stems from his second marriage, in 1371, to the heiress of the king of Castile. Her father has been murdered two years previously by a bastard half-brother who has usurped his throne. Gaunt, with a chance to win Castile for himself, begins to play a role in Iberian politics. His opposition to the present regime in Castile makes him a natural ally of the king of Portugal.

Chances of success are much improved by the Portuguese victory over Castile at Aljubarrota in 1385. The following year the new Portuguese king, John I, proposes an alliance with England. It is formalized in May 1386 as the Treaty of Windsor.

Binding in its terms, and never revoked, this treaty is the reason why Portugal is often described as England's oldest ally.

Two months later John of Gaunt arrives in Portugal to attempt a joint Anglo-Portuguese campaign against Castile. In the event it leads to nothing except a marriage.

In 1387 the Portuguese king marries Gaunt's daughter, Philippa of Lancaster. She is said to have introduced English customs and styles to the Portuguese court - including even architectural elements in the abbey of Batalha where she lies beside her husband. Any such influence may derive from English masons, possibly brought over for the project on which work begins in about 1388. The architect of the abbey, Afonso Domingues, is Portuguese.