The county of Portugal was awarded by the king of León and Castile at the end of the 11th. century to County Henry of Burgundy, and his son was the first king of an independent Portugal.
early in the 13th. century, the king Sancho II (1223-1248)was a brother of Alphonso, count of Boulogne, a title gained by his marriage to Matilda. A papal bull of 1246 ordered the replacement of Sancho by Alphonso. Sancho resisted, but died in 1248 and Alphonso III completed the re-conquest of the Algarve and moved the capital of Portugal from Coimbra to Lisbon. While still married to Matilda, Alphonso married Beatrizde Guzmán, daughter of Alphonso X of Castile and gained the Algarve as a fief of Castile. In 1262 the bigamous marriage and the son denis were legalised. Alphonso II was finally excommunicated and died in 1279.
Denis married Isabella, daughter of Peter III of Aragon (she later became St. Elizabeth of Portugal - the Reina Santa, and finally died in 1336.) Denis (ruled 1279-1325) founded the University in 1290, first at Lisbon, then moved to Coimbra, and engaged a Genoese admiral, Emmanuele di Pezagna in 1317 to build a Portugese navy. Denis was a poet and a patron of literature. His son Alphonso gained the Portugese crown in 1325 on the death of his father, and kept the peace until his mother's death in 1336 (she had retired to the convent of Santa Clara at Coimbra.) Alphonso IV then made war with Castile until 1340 when they combined to defeat the Muslims in Andalusia.
Pedro I, the son of Alphonso IV married Constança, daughter of the Castilian Infante Juan Manuel, and reigned from 1357-67. He had a son, Ferdinand by Constança and two sons by Inez de Castro - João was one of the sons. Inez was killed in 1355.
Meanwhile Pedro the cruel and Henry of Trastramara were disputing the crown of Castile until pedro was killed. henry of Trastramara invaded Portugal in 1369, and by the peace of Alcoutim (1371) Ferdinand renounced his claim to several Castilian towns and agreed to marry Henry's daughter. Instead he married Leonor Teles (who was Portugese, and already married.) he nade alliance with John of Gaunt who had married Constança, the eldest daughter of Pedro the Cruel, and who had claimed the throne od castile. In 1372 Henry of TRastramara invaded Portugal and beseiged Lisbon. ferdinand then broke his alliance with John of Gaunt and allied with Castile, but on the death of Henry he again challenged Castile and renewed his alliance with England.
In 1381 Edmund Langley, earl of cambridge and later Duke of yYork, took an army to Portugal to help invade Castile (of which his brother John claimed the throne.) Edmund's son Edward was then betrothed to Ferdinand's only daughterm Beatrice, but Ferdinand made peace again with Castile in 1382, and married Beatrice to a Castilian prince, John I of castile. When Ferdinand died in 1383, Leonor Teles became regent and castile claimed the Portugese crown. Leonor's lover, João Fernandes Andeira, count of Ourém had intrigued with both England and Castile was rejected by the Portugese who chose João, Grand Master of Avis, who killed Ourém (6 december 1383.)
Leonor went into exile in Santarém, and Castile sent an army to her aid which beseiged Lisbon for five months until the seige was broken by an outbreak of the plague. The cortes met at Coimbra in April and declared João the king, but some towns still held out for Castile, holding that the Queen of Castile was the rightful heir. João was an illegitiate son of Peter and
In August 1385, João Iand an army including English archers invaded central Portugal and defeated the Castilians at Aljubarrota (15 August 1385.) A second victory soon followed, and João was assured of his kingdom and became a powerful potential ally for England. The treaty of Windsor (9 May 1386) established a firm alliance between the crowns of England and Portugal, and John of Gaunt attempted an invasion of Castile with João I. This was unsuccessful, but gaunt's daughter, Philippa od Lancaster, married João in 1387 and introduced many English customs into Portugal.
João and Philippa had four sons and a daughter, Isabella who married Philip the Good of Burgandy. João's eldest son Duarte suceeded him, and the younger son Henry became the famous Henry the Navigator.
Duarte reigned 1433-1438. His son Alphonso V was only a child when Duarte died, but after a regency, ruled until his death in 1481.
Pedro Álvares Cabral discovered the South American continent in 1500.
Under João I (1385-1433) the Portugese court became a centre of literary culture. João himself wrote a 'Livro da Monaria' (a treatise on the chase.) His son Duarte (later to known as 'the Philosopher King') collected a library of the ancients, and ordered many translations into the vernacular, including John Gower's 'Confessio Amantis and many medaeval poems and histories.
The Portugese language was first written about the end of the 12th. century and changed little after the 13th. century. Portugese quickly became an important literary language, and include much lyrical poetry and historical writing. When Alphonso III became king in 1248 he had lived for 3 years in France, and he brought many poets with him and became a patron of literature. A period of greeat poetic activity lead to the Cancioneiro da Ajuda, the oldest existing collection of Portugese verse. The literary activity eached its highest point in the reign of denis (1279-1325) who was educated by a Frenchman, Aymeric of Cahors, and founded the Unversity in 1290, and stimulated much translation from Latin, Spanish and Arabic into the vernacular.
There was early popularity of the 'matière de Bretagne', and five songs based on Breton lais start the Cancioeiro Colocci-Brancuti, a compilation of the early ideals of chivalry and adventure associated with the Knights of the Round Table. The 'História dos Cavaleiros da mesa Redonda e da Demanda do Santo Graall is an adaption from the Frenchdating from the early 14th. century, and from this derived the Amadis de Gaula, possibly dated about 1350 and possibly authored by Vasco de Lobeira.