Early life and reign until majority
James was born at Montpellier as the only son of Peter II of Aragon and Marie of Montpellier. As a child, James was made a pawn in the power politics of Provence, where his father was engaged in struggles helping the Cathar heretics of Albi against the Albigensian Crusaders led by Simon IV de Montfort, Earl of Leicester, who were trying to exterminate them. Peter endeavoured to placate the northern crusaders by arranging a marriage between his son James and Simon's daughter, when the former was only two years old. He entrusted the boy to be educated in Montfort's care in 1211, but was soon forced to take up arms against him, dying at the Battle of Muret on 12 September 1213. Montfort would willingly have used James as a means of extending his own power had not the Aragonese appealed to Pope Innocent III, who insisted that Montfort surrender him. James was handed over to the papal legate Peter of Benevento at Carcassonne in May or June 1214.
James was then sent to Monzón, where he was entrusted to the care of
Guillem de Montredó, the head of the Knights Templar in Spain and Provence; the regency meanwhile fell to his great-uncle Sancho, Count of Roussillon, and his son, the king's cousin, Nuño. The kingdom was given over to confusion until, in 1217, the Templars and some of the more loyal nobles brought the young king to Zaragoza.
In 1221, he was married to Eleanor, daughter of Alfonso VIII of Castile. The next six years of his reign were full of rebellions on the part of the nobles. By the Peace of Alcalá of 31 March 1227, the nobles and the king came to terms.