In the later 9th century, the Carolingians ceased to be powerful sovereigns in the outlying regions of their empire and the Moors of the Ebro valley simultaneously ceased being a threat to the Christian population to their north. As Carolingian influence waned, the counts of Aragón sought new allies. In 820 Charlemagne's vassal, Count
Aznar I, was ejected from the county by his son-in-law
García 'the Bad', who rode to power on the back of troops supplied by
Íñigo Arista, ruler of the fledgling
Kingdom of Pamplona. He then repudiated his wife in order to marry Íñigo's daughter. In 844, Aznar's son
Galindo was forced to make himself a vassal of Íñigo in order to secure his return and succession to the county. Count
Aznar II looked south, marrying his daughter to the
wali of
Huesca,
Muhammad al-Tawil. The Navarrese also expanded their kingdom to the region south of the Aragón, a zone devastated militarily by the Arabs in the preceding centuries of conflict. The Navarrese fortification of this area severely curtailed the possibility of Aragonese expansion via reconquest by cutting off the obvious route of such conquest. The death of
Galindo Aznárez II without surviving legitimate sons resulted in a division of his lands, with
Sobrarbe passing with a daughter to the
counts of Ribagorza, while Aragon itself fell under the direct control of the Pamplona crown, king
García Sánchez I marrying
Andregota Galíndez, another daughter of the defunct count. During the century of direct Navarrese lordship, the diminutive county of Aragon retained a separate administration and its charters referred to it as the "land of the Aragonese lords", and counts were appointed by the kings, starting with the illegitimate son of the last autonomous count. In the 10th century the religious centre of the county moved south to
San Juan de la Peña. San Juan, contrary to San Pedro, had been founded by Christian refugees from Moorish
Zaragoza and the monastery had a militant Visigothic character; the war with the Muslims was espoused and the
Visigothic rite was the standard of worship. In 922, the Aragonese had finally secured their own bishopric. The old itinerant "bishops of Aragon" (sometimes called
bishops of Huesca or Jaca) were established in the valley of
Borau. The bishops regularly took up residence in one of the major monasteries, like San Juan, San Pedro, or
San Adrián de Sasave. The location of the see also serves as evidence that the upper valleys in the south of the country were becoming increasingly more populated as the region south of the river Aragón became more fortified and the Moorish threat diminished further. This frontier zone, too, was seeing repopulation in light of militarisation. == Conversion into kingdom ==