The chief problems now confronting the monarchy were no longer military, but social, economic and constitutional, it is true that the reign of Diniz was not a period of uninterrupted peace. At the outset his legitimacy was disputed by his brother Alphonso, and a brief civil war ensued. Hostilities between Portugal and the reunited kingdoms of Leon and Castile were terminated in 1297 by a treaty of alliance, in accordance with which Ferdinand IV of Castile married Constance, daughter of Diniz, while Alphonso, son of Diniz, married Beatrice of Castile, daughter of Ferdinand. A further outbreak of civil war, between the king and the heir--apparent, was averted in 1293 by the queen-consort Isabella of Portugal, who had married Diniz in 1281, and was canonized for her many virtues in the 16th century. She rode between the hostile camps, and succeeded in arranging an honourable peace between her husband and her son.
These wars were too brief to interfere seriously with the social reconstruction to which the king devoted himself. At his accession the Portuguese people was far from homogeneous; it would be long before its component races "Moors and Mozarabs of the south, Galicians of the north, Jews and foreign crusaders" could be fused into one nationality. There were also urgent economic problems to be solved. The Moors had made Alemtejo the granary of Portugal, but war had undone their work, and large tracts of land were now barren and depopulated. Commerce and education had similarly been subordinated to the struggle for national existence. The machinery of administration was out of date and complicated by the authority of feudal and ecclesiastical courts. The supremacy of the Crown, though recognized, was still unstable. It was Diniz who initiated the needful reforms. He earned his title of the rei lavrador or "farmer king" by introducing improved methods of cultivation and founding agricultural schools. He encouraged maritime trade by negotiating a commercial treaty with England (1294) and forming a royal navy (1317) under the command of a Genoese admiral named Emmanuele di Pezagna (Manoel Pessanha). In 1290 he founded the University of Coimbra. He was a poet and a patron of literature and music. His chief administrative reforms were designed to secure centralized government and to limit the jurisdiction of feudal courts. He encouraged and nationalized the military orders. In 1290 the Portuguese knights of São Thiago (Santiago) were definitely separated from the parent Spanish order. The orders of Crato and of St Benedict of Aviz had already been established, the traditional dates of their incorporation being 1113 and 1162. After the condemnation of the Templars by Pope Clement V (1312) an ecclesiastical commission investigated the charges against the Portuguese branch of the order, and found in its favor. As the Templars were rich, influential and loyal, Diniz took advantage of the death of Clement V. to maintain the order under a new name; the Order of Christ, as it was henceforth called, received the benediction of the pope in 1319 and subsequently played an important part in the colonial expansion of Portugal.
Alphonso IV adhered to the matrimonial policy initiated by Diniz. He arranged that his daughter Maria should wed Alfonso XI of Castile (1328), but the marriage precipitated the war it was intended to avert, and peace was only restored (1330) after Queen Isabella had again intervened. Pedro, the crown prince, afterwards married Constance, daughter of the duke of Peñafiel (near Valladolid), 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 (1340). In 1347 he married his daughter Leonora (Lenor) to Pedro IV of Aragon. The later years of his reign were darkened by the tragedy of Inez de Castro. He died in 1357, and the first act of his successor, Pedro the Severe, was to take vengeance on the murderers 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, where in 1352 Edward III issued a proclamation in favor of Portuguese traders, and in 1353 the Portuguese envoy Afonso Martins Alho signed a covenant with the merchants of London, guaranteeing mutual good faith in all commercial dealings.
The foreign policy of Diniz, Alphonso IV and Pedro I had been, as in rule, successful in its main object, the preservation of peace with the Christian kingdoms of Spain; in consequence, the Portuguese had advanced in prosperity and culture. They had supported the monarchy because it was a national institution, hostile to the tyranny of nobles and clergy. During the reign of Ferdinand (1367-1383) and under the regency of Leonora the ruling dynasty ceased to represent the national will; the Portuguese people therefore made an end of the dynasty and chose its own ruler. The complex events which brought about this crisis may be briefly summarized.
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); he based his and Leonora, claim on the fact that his grandmother Beatrice (1367-1385) belonged to the legitimate line of Castile. When the majority of the Castilian nobles refused to accept a Portuguese sovereign, and welcomed Henry of Trastamara (see History of Spain), as Henry II of Castile, Ferdinand allied himself with the Moors and Aragonese; but 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 Menezes, whom he eventually married. To avenge this slight, Henry of Castile 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 Ferdinand made peace with Castile in 1374, he renewed his claim in 1380, 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 betrothed his cousin Prince Edward to Beatrice, only child of Ferdinand, who had been recognized as heiress to the throne by the cortes 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 aristocracy, while her tyrannical rule also aroused Rebellion of bitter opposition. The malcontents chose D. John, 1383. 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 (December 6, 1383). Leonora fled to Santarem and summoned aid from Castile, while D. John was proclaimed defender of Portugal. In 1384 a Castilian army invested Lisbon, but encountered 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 defeating the invaders, at Atoleiro and Trancoso in the district of Guarda.
On April 16 1385 the cortes assembled at Coimbra declared the crown of Portugal elective, and at the instance of Joao das Regras, the chancellor, D. John was chosen king. No event in the early constitutional Cortes of history of Portugal is more important than this Coimbra. election, which definitely affirmed the national character of the monarchy. The choice of the grand-master of Aviz ratified the old alliance between the Crown and the military orders; his election by the whole cortes not only ratified the alliance between the Crown and the commons, but also included the nobles and the Church. The nation was unanimous.
Ferdinand had been the last legitimate descendant of Count Henry of Burgundy. With John I. began the rule of a new dynasty, the House of Aviz. The most urgent matter which confronted the king or the group of statesmen, led by Joao das Regras and the "Holy Constable" who inspired his policy was the menace of Castilian aggression. But on August 14 1385 the Portuguese army, aided by 500 English archers, utterly defeated the Castilians at Aljubarrota. By this victory the Portuguese showed themselves equal in military power to their strongest rivals in the Peninsula. In October the "Holy Constable" won another victory at Valverde; early in 1386 5000 English soldiers, under John of Gaunt, reinforced the Portuguese; and by the treaty of Windsor (May 9, 1386), the alliance between Portugal and England was confirmed and extended. Against such a combination the Castilians were powerless; a truce was arranged in 1387 and renewed at intervals until 1411, when peace was concluded. D. Diniz, eldest son of Inez de Castro, claimed the throne and invaded Portugal in 1398, but his supporters were easily crushed. The domestic and foreign policy pursued by John I. until his death in 1433 may be briefly described. At home he endeavoured to reform administration, to encourage agriculture and commerce, and to secure the loyalty of the nobles by grants of land and privileges so extensive that, towards the end of his reign, many nobles who exercised their full feudal rights had become almost independent princes. Abroad, he aimed at peace with Castile and close friendship with England. In 1387 he had married Philipa of Lancaster, daughter of John of Gaunt; Richard II sent troops to aid in the expulsion of D. Diniz; Henry IV, Henry V and Henry VI of England successively ratified the treaty of Windsor; Henry IV made his ally a knight of the Garter in 1400. The convent of Batalha, founded to commemorate the victory of Aljubarrota, is architecturally a monument of the English influence prevalent at this time throughout Portugal.
The cortes of Caimbra, the battle of Aljubarrota and the treaty of Windsor mark the three final stages in the consolidation of the monarchy. A period of expansion oversea began in the same reign, with the capture of Ceuta in Morocco. The three eldest sons of King John and Queen Philippa, Edward, Pedro and Henry, afterwards celebrated as Prince Henry the Navigator desired to win knighthood by service against the Moors, the historic enemies of their country and creed. In 1415 a Portuguese fleet, commanded by the king and the three princes, set sail for Ceuta. English men-at-arms were sent by Henry V to take part in the expedition, which proved successful. The town was captured and garrisoned, and thus the first Portuguese outpost was established on the mainland of Africa.