The origin of Portugal, as a separate state, was an incident in the Christian reconquest of Spain. Towards the close of the 11th century crusading knights came from every part of Europe to aid the kings of northern and central Spain in driving out the Moors. Among these adventurers was Count Henry of Burgundy, an ambitious warrior who, in 1095, married Theresa, natural daughter of Alfonso VI, king of Leon. The county of Portugal, which had already been won back from the Moors (1055-1064), was included in Theresa's dowry. Count Henry ruled as a vassal of Alphonso VI, whose Galician marches were thus secured against any sudden Moorish raid. But in 1109 Alphonso VI died, bequeathing all his territories to his legitimate daughter Urraca, and Count Henry at once invaded Leon, hoping to add to his own dominions at the expense of his suzerain.
After three years of war against Urraca and other rival claimants to the throne of Leon, Count Henry himself died in 1112. He left Theresa to govern Portugal north of the Mondego during the minority of her infant son Afonso Henriques (Alphonso I): south of the Mondego the Moors were still supreme.
Theresa renewed the struggle against her half-sister and suzerain Urraca in 1116-1117, and again in 1120; in 1121 she was besieged in Lanhoso and captured. But a peace was negotiated by the archbishops Diogo Gelmires of Santiago de Compostela and Burdino of Braga, rival churchmen whose wealth and military resources enabled them to dictate terms. Bitter jealousy existed between the two prelates, each claiming to be primate "of all the Spains," and their antagonism had some historical importance in so far as it fostered the growth of separatist tendencies among the Portuguese. But the quarrel was temporarily suspended because both Gelmires and Burdino had reason to dread the extension of Urraca's authority. It was arranged that Theresa should be liberated and should continue to hold the county of Portugal as a fief (honor) of Leon.
During the next five years she lavished wealth and titles upon her lover Fernando Peres, count of Trava, thus estranging her son, the archbishop of Braga and the nobles, most of whom were foreign crusaders. In 1128, after her power had been crushed in another unsuccessful conflict with Leon and Castile, she was deposed by her own rebellious subjects and exiled in company with Peres. She died in 1130.
Alphonso, who became count of Portugal in 1128, was one of the warrior heroes of medieval romance; his exploits were sung by troubadours throughout south-western Europe, and even in Africa "ibn Errik" "the son of Henry" was known and feared. The annals of his reign have been encumbered with a mass of legends, among which must be included the account of a cortes held at Lamego in 1143; probably also the description of the Valdevez tournament, in which the Portuguese knights are said to have vanquished the champions of Leon and Castile.
Alphonso was occupied in almost incessant border fighting against his Christian or Moorish neighbours. Twelve years of campaigning on the Galician frontier were concluded in 1143 by the peace of Zamora, in which Alphonso was recognized as independent of any Spanish sovereign, although he promised to be a faithful vassal of the pope and to pay him a yearly tribute of four ounces of gold. In 1167, however, the war was renewed. Alphonso succeeded in conquering part of Galicia, but in attempting to capture the frontier fortress of Badajoz he was wounded and forced to surrender to Ferdinand II of Leon (1169). Ferdinand was his son-in-law, and was probably disposed to leniency by the imminence of a Moorish invasion in which Portugal could render useful assistance. Alphonso was therefore released under promise to abandon all his conquests in Galicia.
He had already won many victories over the Moors. At the beginning of his reign the religious fervor which had sustained the Almoravide dynasty was rapidly subsiding; in Portugal independent Moorish chiefs ruled over cities and petty states, ignoring the central government; in Africa the Almohades were destroying the remnants of the Almoravide power. Alphonso took advantage of these dissentions to invade Alemtejo, reinforced by the Templars and Hospitallers, whose respective headquarters were at Soure and Thomar.
On July 25 1139 he defeated the combined forces of the Moors on the plains of Ourique, in Alemtejo. Legend has magnified the victory into the rout of 200,000 Moslems under five kings; but so far was the battle from being decisive that in 1140 the Moors were able to seize the fortress of Leiria, built by Alphonso in 1135 as an outpost for the defence of Coimbra, his capital. In 114? they defeated the Templars at Soure. But on March 15 1147 Alphonso stormed the fortress of Santarem, and about the same time a band of crusaders on their way to Palestine landed at Oporto and volunteered for the impending siege of Lisbon. Among them were many Englishmen, Germans and Flemings, who were afterwards induced to settle in Portugal. Aided by these powerful allies, Alphonso captured Lisbon on October 24 1147.
This was the greatest military achievement of his reign. The Moorish garrisons of Palmella, Cintra and Almada soon capitulated, and in 1158 Alcacer do Sal, one of the chief centres of Moorish commerce, was taken by storm. At this time, however, the Almohades had triumphed in Africa and invaded the Peninsula, where they were able to check the Portuguese reconquest, although isolated bands of crusading adventurers succeeded in establishing themselves in various cities of Alemtejo. The most famous of these free-lances was Giraldo Sempavor ("Gerald the Fearless"), who captured Evora in 1166.
In 1171 Alphonso concluded a seven years truce with the Moors; weakened by his wound and by old age, he could no longer take the field, and when the war broke out afresh he delegated the chief command to his son Sancho. Between 1179 and 1184 the Moors retrieved many of their losses in Alemtejo, but were unable to retake Santarem and Lisbon. Alphonso died on December 6 1185. He had secured for Portugal the status though not the name of an independent kingdom, and had extended its frontier southwards from the Mondego to the Tagus. He had laid the foundation. of its navy and had strengthened, if he did not inaugurate, that system of co-operation between the Crown and the military orders which afterwards proved of incalculable service in the maritime and colonial development of the nation.
Sancho I continued the war against the Moors with varying fortune. In 1189 he won Silves, then the capital of Algarve; in 1192 he lost not only Algarve but the greater part of Alemtejo, including Alcacer do Sal. A peace was then arranged, and for the next eight years Sancho was engaged in hostilities against Alfonso IX. of Leon. The motives and course of this indecisive struggle are equally obscure. It ended in 1201, and the last decade of Sancho's reign was a period of peaceful reform which earned for the king his popular name of o Povoador, the "maker of towns."
He granted fresh charters to many cities, legalizing the system of self-government which the Romans had bequeathed to the Visigoths and the Moors had retained or improved. Lisbon had already (1179) received a charter from Alphonso I. Sancho also endeavoured to foster immigration and agriculture, by granting estates to the military orders and municipalities on condition that the occupiers should cultivate or colonize their lands. Towards the close of his reign he became embroiled in a dispute with Pope Innocent III. He had insisted that priests should accompany their flocks in battle, had made them amenable to secular jurisdiction, had withheld the tribute due to Rome and had even claimed the right of disposing of ecclesiastical domains. Finally he had quarreled with Martinho Rodrigues, the unpopular bishop of Oporto, who was besieged for five months in his palace and then forced to seek redress in Rome (1209). As Sancho was in weak health and had no means of resisting Papal pressure, he made full submission (1210); aid after bestowing large estates on his sons and daughters, he retired into the monastery of Alcobaca, where he died in 1211.
The reign of Alphonso II ("the Fat") is noteworthy for the first meeting of the Portuguese cortes, to which the upper hierarchy of the Church and the nobles (Hidalgos and ricos homens) were summoned by royal writ. The king Alphonso II, 1211-1223, was no warrior, but in 1212 a Portuguese contingent aided the Castilians to defeat the Moors at Las Navas de Tolosa, and in 1217 the ministers, bishops and captains of the realm, reinforced by foreign crusaders, retook Alcacer do Sal.
Alfonso II repudiated the will of his father, refused to surrender the estates left to his brothers, who went into exile, and only gave up the property bequeathed to his sisters after a prolonged civil war in which Alfonso IX of Leon took part against them. Even then he compelled the heiresses to take the veil. His attempts to strengthen the monarchy and fill the treasury at the expense of the Church resulted in his excommunication by Pope Honorius III, and Portugal remained under interdict until Alphonso II died in 1223.
Sancho II succeeded at the age of thirteen. To secure the removal of the interdict the leading statesmen who were identified with the policy of his father Goncalo Mendes the chancellor, Pedro Annes the lord chamberlain (mordomo-mor) and Vicente, dean of Lisbon resigned their offices. Estevao Soares, archbishop of Braga, placed himself at the head of the nobles and churchmen who threatened to usurp the royal power during Sancho II's minority, and negotiated an alliance with Alphonso IX, by which it was arranged that the Portuguese should attack Elvas, the Spaniards Badajoz.
Elvas was taken from the Moors in 1226, and in 1227 Sancho assumed control of the kingdom. He reinstated Pedro Annes, made Vicente chancellor, and appointed Martim Annes chief standard-bearer (alferes mor). He continued the crusade against the Moors, who were driven from their last strongholds in Alemtejo, and in 1239-1244, after a dispute with Rome which was once more ended by the imposition of an interdict and the submission of the Portuguese ruler, he won many successes in the Algarve. But his career of conquest was cut short by a revolution (1245), for which his marriage to a Castilian lady, D. Mecia Lopez de Haro, furnished a pretext.
The legitimacy of the union has been questioned, on grounds which appear insufficient; but of its unpopularity there can be no doubt. The bishops, resenting the favour shown by Sancho to his father's anti-clerical ministers, took advantage of this unpopularity to organize the rebellion. They found a leader in Sancho's brother Alphonso, count of Boulogne, who owed his title to a marriage with Matilda, countess of Boulogne. The pope issued a bull of deposition in favour of Alphonso, who reached Lisbon in 1246; and after a civil war lasting two years Sancho II retired to Toledo, where he died in January 1248.
One of the first acts of the usurper, and one of the most important, was to abandon the semi-ecclesiastical titles of visitor (visitador) or defender (curador) of the realm, and to proclaim himself king (rei). Hitherto the position of the monarchy had been precarious; as in Aragon the nobles and the church had exercised a large measure of control over their nominal head, and though it would be pedantry to over-emphasize the importance of the royal title, its assumption by Alphonso III does mark a definite stage in the evolution of a national monarchy and a centralized government.
A second stage was reached shortly afterwards by the conquest of Algarve, the last remaining stronghold of the Moors. This drew down upon Portugal the anger of Alfonso X of Castile, surnamed the Wise, who claimed suzerainty over Algarve. The war which followed was ended by Alphonso III consenting to wed Donna Beatriz de Guzman, illegitimate daughter of Alphonso X, and to hold Algarve as a fief of Castile. The celebration of this marriage, while Matilda, countess of Boulogne and first wife of Alphonso III, was still alive, entailed the imposition of an interdict upon the kingdom. In 1254 Alphonso III summoned a cortes at Leiria, in which the chief cities were represented, as well as the nobles and clergy.
Fortified by their support the king refused to submit to Rome. At the cortes of Coimbra (1261), he further strengthened his position by conciliating the representatives of the cities, who denounced the issue of a debased coinage, and by recognizing that taxation could not be imposed without consent of the cortes. The clergy suffered more than the laity under a prolonged interdict, and in 1262 Pope Urban VI legalized the disputed marriage and legitimized Dom Diniz, the king's eldest son. Thus ended the contest for supremacy between Church and Crown.
The monarchy owed its triumph to its championship of national interests, to the support of the municipalities and military orders, and to the prestige gained by the royal armies in the Moorish and Castilian wars. In 1263 Alphonso X renounced his claim to suzerainty over Algarve, and thus the kingdom of Portugal simultaneously reached its present European limits and attained its complete independence. Lisbon was henceforth recognized as the capital. Alphonso III continued to reign until his death in 1279, but the peace of his later years was broken by the rebellion (1277-1279) of D. Diniz.