Alphonso IV. adhered to the matrimonial policy initiated by Diniz. He arranged that his daughter Maria should wed Alphonso XI. of Castile (1328), but the marriage precipitated the war it was intended to avert, and peace was only restored (133o) after Queen Isabella had again intervened. Pedro, the crown prince, afterwards married Constance, daughter of the duke of Pefiafiel (near Valla dolid), and Alphonso IV. brought a strong Portuguese army to aid the Castilians against the Moors of Granada and their African allies. In the victory won by the Christians on the banks of the river Salado, near Tarifa, he earned his title of Alphonso the Brave (134o). In 1347 he married his daughter Leonora to Pedro IV. of Aragon. The later years of his reign were darkened by the trag edy of Inez de Castro (q.v.). He died in 1357, and the first act of his successor, Pedro the Severe, was to take vengeance on the mur derers of Inez. Throughout his reign he strengthened the central Government at the expense of the aristocracy and the Church, by a stern enforcement of law and order. In 1361, at the cortes of Elvas, it was enacted that the privileges of the clergy should only be deemed valid in so far as they did not conflict with the royal prerogative. Pedro maintained friendly relations with England.
During the reign of Ferdinand (1367-83) and under the regency of Leonora the ruling dynasty ceased to represent the national will. Ferdinand, a weak but ambitious and unscrupulous king, claimed the thrones of Castile and Leon, left vacant by the death of Pedro I. of Castile (1369). In 1371 Pope Gregory XI. intervened, and it
was decided that Ferdinand should renounce his claim and marry Leonora, the daughter of his successful rival. Ferdinand, however, preferred his Portuguese mistress, Leonora Telles de Meneses, whom he eventually married. To avenge this slight, Henry of Cas tile invaded Portugal and besieged Lisbon. Ferdinand appealed to John of Gaunt, who also claimed the throne of Castile, on behalf of his wife Constance, daughter of Pedro I. of Castile. An alliance between Portugal and England was concluded; and although Ferdi nand made peace with Castile in 1374, he renewed his claim in 138o, after the death of Henry of Castile, and sent Joao Fernandes Andeiro, count of Ourem, to secure English aid. In 1381 Richard II. of England despatched a powerful force to Lisbon, and be trothed his cousin, Prince Edward, to Beatrice, only child of Ferdi nand, who had been recognized as heiress to the throne by the cor tes of Leiria (1376). In 1383, however, Ferdinand made peace with John I. of Castile at Salvaterra, deserting his English allies, who retaliated by ravaging part of his territory. By the treaty of Salvaterra it was agreed that Beatrice should marry John I. Six months later Ferdinand died, and in accordance with the terms of the treaty Leonora became regent until the eldest son of John I. and Beatrice should be of age.
Leonora had long carried on an intrigue with the count of Ourem, whose influence was resented by the leaders of the aristoc racy, while her tyrannical rule also aroused bitter opposition. The malcontents chose D. John, grand-master of the knights of Aviz and illegitimate son of Pedro the Severe, as their leader, organized a revolt in Lisbon, and assassinated the count of Ourem within the royal palace (Dec. 6, 1383). Leonora fled to Santarem and sum moned aid from Castile, while D. John was proclaimed defender of Portugal. In 1384 a Castilian army invested Lisbon, but en countered a heroic resistance, and after five months an outbreak of plague compelled them to raise the siege. John I. of Castile, discovering or alleging that Leonora had plotted to poison him, imprisoned her in a convent at Tordesillas, where she died in 1386. Before this, Nuno Alvares Pereira, constable of Portugal, had gained his popular title of "The Holy Constable" by twice defeat ing the invaders, at Atoleiro and Trancoso in the district of Guarda. On April 16, 1385, the cortes assembled at Coimbra de clared the crown of Portugal elective, and at the instance of Joao das Regras, the chancellor, D. John was chosen king.