Alfonso VII of León and Castile

Alfonso VII (1 March 1105 – 21 August 1157), called the Emperor (el Emperador), became the King of Galicia in 1111 and King of León and Castile in 1126. Alfonso, born Alfonso Raimúndez, first used the title Emperor of All Spain, alongside his mother Urraca, once she vested him with the direct rule of Toledo in 1116. Alfonso later held another investiture in 1135 in a grand ceremony reasserting his claims to the imperial title. He was the son of Urraca of León and Raymond of Burgundy, the first of the House of Ivrea to rule in the Iberian peninsula.

Alfonso was a dignified and somewhat enigmatic figure. His rule was characterised by the renewed supremacy of the western kingdoms of Christian Iberia over the eastern (Navarre and Aragón) after the reign of Alfonso the Battler. He also sought to make the imperial title meaningful in practice, though his attempts to rule over both Christian and Muslim populations was even less successful. His hegemonic intentions never saw fruition, however. During his tenure, Portugal became de facto independent, in 1128, and was recognized as de jure independent, in 1143. He was a patron of poets, including, probably, the troubadour Marcabru.

Succession to three kingdoms
In 1111, Diego Gelmírez, Bishop of Compostela and the count of Traba, crowned and anointed Alfonso King of Galicia in the cathedral of Santiago de Compostela. He was a child, but his mother had (1109) succeeded to the united throne of León-Castile-Galicia and desired to assure her son's prospects and groom him for his eventual succession. By 1125 he had inherited the formerly Muslim Kingdom of Toledo. On 10 March 1126, after the death of his mother, he was crowned in León and immediately began the recovery of the Kingdom of Castile, which was then under the domination of Alfonso the Battler. By the Peace of Támara of 1127, the Battler recognised Alfonso VII of Castile. The territory in the far east of his dominion, however, had gained much independence during the rule of his mother and experienced many rebellions. After his recognition in Castile, Alfonso fought to curb the autonomy of the local barons.

When Alfonso the Battler, King of Navarre and Aragón, died without descendants in 1134, he willed his kingdom to the military orders. The aristocracy of both kingdoms rejected this. García Ramírez, Count of Monzón was elected in Navarre while Alfonso pretended to the throne of Aragón. The nobles chose another candidate in the dead king's brother, Ramiro II. Alfonso responded by reclaiming La Rioja and "attempted to annex the district around Zaragoza and Tarazona".

In several skirmishes, he defeated the joint Navarro-Aragonese army and put the kingdoms to vassalage. He had the strong support of the lords north of the Pyrenees, who held lands as far as the River Rhône. In the end, however, the combined forces of the Navarre and Aragón were too much for his control. At this time, he helped Ramon Berenguer III, Count of Barcelona, in his wars with the other Catalan counties to unite the old Marca Hispanica.

Imperial rule
A vague tradition had always assigned the title of emperor to the sovereign who held León. Sancho the Great considered the city the imperiale culmen and minted coins with the inscription Imperator totius Hispaniae after being crowned in it. Such a sovereign was considered the most direct representative of the Visigothic kings, who had been themselves the representatives of the Roman Empire. But though appearing in charters, and claimed by Alfonso VI of León and Alfonso the Battler, the title had been little more than a flourish of rhetoric.

On 26 May 1135, Alfonso was crowned "Emperor of Spain" in the Cathedral of León. By this, he probably wished to assert his authority over the entire peninsula and his absolute leadership of the Reconquista. He appears to have striven for the formation of a national unity which Spain had never possessed since the fall of the Visigothic kingdom. The elements he had to deal with could not be welded together. The weakness of Aragon enabled him to make his superiority effective. After Afonso Henriques recognised him as liege in 1137, Alfonso VII lost the Battle of Valdevez in 1141 thereby affirming Portugal's independence in the Treaty of Zamora (1143). In 1143, he himself recognised this status quo and consented to the marriage of Petronila of Aragon with Ramon Berenguer IV, a union which combined Aragon and Catalonia into the Crown of Aragon.

War against Al-Andalus
Alfonso was a pious prince. He introduced the Cistercians to Iberia by founding a monastery at Fitero. He adopted a militant attitude towards the Moors of Al-Andalus, especially the Almoravids. From 1138, when he besieged Coria, Alfonso led a series of crusades subjugating the Almoravids. After a seven-month siege, he took the fortress of Oreja near Toledo and, as the Chronica Adefonsi Imperatoris tells it: . . . early in the morning the castle was surrendered and the towers were filled with Christian knights, and the royal standards were raised above a high tower. Those who held the standards shouted out loud and proclaimed "Long live Alfonso, emperor of León and Toledo!"

In 1142, Alfonso besieged Coria a second time and took it. In 1144, he advanced as far as Córdoba. Two years later, the Almohads invaded and he was forced to refortify his southern frontier and come to an agreement with the Almoravid Ibn Ganiya for their mutual defence. When Pope Eugene III preached the Second Crusade, Alfonso VII, with García Ramírez of Navarre and Ramon Berenguer IV, led a mixed army of Catalans and Franks, with a Genoese–Pisan navy, in a crusade against the rich port city of Almería, which was occupied in October 1147. A third of the city was granted to Genoa and subsequently leased out to Otto de Bonvillano, a Genoese citizen. It was Castile's first Mediterranean seaport. In 1151, Alfonso signed the Treaty of Tudilén with Ramon Berenguer. The treaty defined the zones of conquest in Andalusia in order to prevent the two rulers from coming into conflict. Six years later, Almería entered into Almohad possession. Alfonso was returning from an expedition against them when he died on 21 August 1157 in Las Fresnedas, north of the Sierra Morena.

Legacy
Alfonso was at once a patron of the church and a protector, though not a supporter of, the Muslims, who were a minority of his subjects. His reign ended in an unsuccessful campaign against the rising power of the Almohads. Though he was not actually defeated, his death in the pass, while on his way back to Toledo, occurred in circumstances which showed that no man could be what he claimed to be — "king of the men of the two religions." Furthermore, by dividing his realm between his sons, he ensured that Christendom would not present the new Almohad threat with a united front.

Family
In November 1128, he married Berenguela, daughter of Ramon Berenguer III, Count of Barcelona. She died in 1149. Their children were:
 * Sancho III of Castile (1134 – 1158)
 * Ramon, living 1136, died in infancy
 * Ferdinand II of León (1137 – 1188)
 * Constance (c.1138 – 1160), married Louis VII of France
 * Sancha (c. 1139 – 1179), married Sancho VI of Navarre
 * García (c. 1142 – 1145/6)
 * Alfonso (1144/1148-c. 11491149)

In 1152, Alfonso married Richeza of Poland, the daughter of Ladislaus II the Exile. They had:
 * 1) Ferdinand, (1153 – 1157)
 * 2) Sancha (1155 – 1208), the wife of Alfonso II of Aragón.

Alfonso also had two mistresses, having children by both. By an Asturian noblewoman named Gontrodo Pérez, he had an illegitimate daughter, Urraca (1132 – 1164), who married García Ramírez of Navarre, the mother retiring to a convent in 1133. Later in his reign, he formed a liaison with Urraca Fernández, widow of count Rodrigo Martínez and daughter of Fernando García de Hita, having a daughter Stephanie the Unfortunate (1148 – 1180), who was killed by her jealous husband, Fernán Ruiz de Castro.