Alfonso spent his first four years as king in near-constant war with the Muslims.
 In 1105, he conquered Ejea and Tauste and refortified Castellar and Juslibol.
 In 1106, he defeated Ahmad II al-Musta'in of Zaragoza at Valtierra.
 In 1107, he took Tamarite de Litera and Esteban de la Litera.
 Then followed a period dominated by his relations with Castile and León through his wife, Urraca.
 He resumed his conquest in 1117 by conquering Fitero, Corella, Cintruénigo, Murchante, Monteagudo, and Cascante.

In 1118, the Council of Toulouse declared a crusade to assist in the conquest of Zaragoza.
 Many Frenchmen consequently joined Alfonso at Ayerbe.
 They took Almudévar, Gurrea de Gállego, and Zuera, besieging Zaragoza itself by the end of May. The city fell on 18 December, and the forces of Alfonso occupied the Azuda, the government tower.
 The great palace of the city was given to the monks of Bernard.
 Promptly, the city was made Alfonso's capital.
 Two years later, in 1120, he defeated a Muslim army intent on reconquering his new capital at the Battle of Cutanda.
He promulgated the fuero of tortum per tortum, facilitating taking the law into one's own hands, which among others reassumed the Muslim right to dwell in the city and their right to keep their properties and practice their religion under their own jurisdiction as long as they maintained tax payment and relocated to the suburbs.

In 1119, he retook Cervera, Tudejen, Castellón, Tarazona, Ágreda, Magallón, Borja, Alagón, Novillas, Mallén, Rueda, Épila and populated the region of Soria.
 He began the siege of Calatayud, but left to defeat the army at Cutanda trying to retake Zaragoza.
 When Calatayud fell, he took Bubierca, Alhama de Aragón, Ariza, and Daroca (1120).
 In 1123, he besieged and took Lleida, which was in the hands of the count of Barcelona.
 From the winter of 1124 to September 1125, he was on a risky expedition to Peña Cadiella deep in Andalusia.

In the great raid of 1125, he carried away a large part of the subject Christians from Granada, and in the south-west of France, he had rights as king of Navarre.
From 1125 to 1126, he was on campaign against Granada, where he was trying to install a Christian prince, and Córdoba, where he got only as far as Motril.
 In 1127, he reconquered Longares, but simultaneously lost all his Castilian possessions to Alfonso VII.
 He confirmed a treaty with Castile the next year (1128) with the Peace of Támara, which fixed the boundaries of the two realms.

He conquered Molina de Aragón and populated Monzón in 1129, before besieging Valencia, which had fallen again upon the Cid's death.

He went north of the Pyrenees in October 1130 to protect the Val d'Aran.
 Early in 1131, he besieged Bayonne.
 It is said he ruled "from Belorado to Pallars and from Bayonne to Monreal."

At the Siege of Bayonne in October 1131, three years before his death, he published a will leaving his kingdom to three autonomous religious orders based in Palestine and politically largely independent - the Knights Templars, the Hospitallers, and the Knights of the Holy Sepulchre, whose influences might have been expected to cancel one another out.
The will has greatly puzzled historians, who have read it as a bizarre gesture of extreme piety uncharacteristic of Alfonso's character, one that effectively undid his life's work.
Elena Lourie (1975) suggested instead that it was Alfonso's attempt to neutralize the papacy's interest in a disputed succession — Aragon had been a fief of the Papacy since 1068 — and to fend off Urraca's son from her first marriage, Alfonso VII of Castile, for the Papacy would be bound to press the terms of such a pious testament.</ref> Generous bequests to important churches and abbeys in Castile had the effect of making the noble churchmen there beneficiaries who would be encouraged by the will to act as a brake on Alfonso VII's ambitions to break it — and yet among the magnates witnessing the will in 1131 there is not a single cleric.
In the event it was a will that his nobles refused to carry out — instead bringing his brother
Alfonso spent his first four years as king in near-constant war with the Muslims.  In 1105, he conquered Ejea and Tauste and refortified Castellar and Juslibol.  In 1106, he defeated Ahmad II al-Musta'in of Zaragoza at Valtierra.  In 1107, he took Tamarite de Litera and Esteban de la Litera.  Then followed a period dominated by his relations with Castile and León through his wife, Urraca.  He resumed his conquest in 1117 by conquering Fitero, Corella, Cintruénigo, Murchante, Monteagudo, and Cascante.
In 1118, the Council of Toulouse declared a crusade to assist in the conquest of Zaragoza.  Many Frenchmen consequently joined Alfonso at Ayerbe.  They took Almudévar, Gurrea de Gállego, and Zuera, besieging Zaragoza itself by the end of May. The city fell on 18 December, and the forces of Alfonso occupied the Azuda, the government tower.  The great palace of the city was given to the monks of Bernard.  Promptly, the city was made Alfonso's capital.  Two years later, in 1120, he defeated a Muslim army intent on reconquering his new capital at the Battle of Cutanda. He promulgated the fuero of tortum per tortum, facilitating taking the law into one's own hands, which among others reassumed the Muslim right to dwell in the city and their right to keep their properties and practice their religion under their own jurisdiction as long as they maintained tax payment and relocated to the suburbs.
In 1119, he retook Cervera, Tudejen, Castellón, Tarazona, Ágreda, Magallón, Borja, Alagón, Novillas, Mallén, Rueda, Épila and populated the region of Soria.  He began the siege of Calatayud, but left to defeat the army at Cutanda trying to retake Zaragoza.  When Calatayud fell, he took Bubierca, Alhama de Aragón, Ariza, and Daroca (1120).  In 1123, he besieged and took Lleida, which was in the hands of the count of Barcelona.  From the winter of 1124 to September 1125, he was on a risky expedition to Peña Cadiella deep in Andalusia.
In the great raid of 1125, he carried away a large part of the subject Christians from Granada, and in the south-west of France, he had rights as king of Navarre. From 1125 to 1126, he was on campaign against Granada, where he was trying to install a Christian prince, and Córdoba, where he got only as far as Motril.  In 1127, he reconquered Longares, but simultaneously lost all his Castilian possessions to Alfonso VII.  He confirmed a treaty with Castile the next year (1128) with the Peace of Támara, which fixed the boundaries of the two realms.
He conquered Molina de Aragón and populated Monzón in 1129, before besieging Valencia, which had fallen again upon the Cid's death.
He went north of the Pyrenees in October 1130 to protect the Val d'Aran.  Early in 1131, he besieged Bayonne.  It is said he ruled "from Belorado to Pallars and from Bayonne to Monreal."
At the Siege of Bayonne in October 1131, three years before his death, he published a will leaving his kingdom to three autonomous religious orders based in Palestine and politically largely independent - the Knights Templars, the Hospitallers, and the Knights of the Holy Sepulchre, whose influences might have been expected to cancel one another out. The will has greatly puzzled historians, who have read it as a bizarre gesture of extreme piety uncharacteristic of Alfonso's character, one that effectively undid his life's work. Elena Lourie (1975) suggested instead that it was Alfonso's attempt to neutralize the papacy's interest in a disputed succession — Aragon had been a fief of the Papacy since 1068 — and to fend off Urraca's son from her first marriage, Alfonso VII of Castile, for the Papacy would be bound to press the terms of such a pious testament.</ref> Generous bequests to important churches and abbeys in Castile had the effect of making the noble churchmen there beneficiaries who would be encouraged by the will to act as a brake on Alfonso VII's ambitions to break it — and yet among the magnates witnessing the will in 1131 there is not a single cleric. In the event it was a will that his nobles refused to carry out — instead bringing his brother 
Alfonso the Battler