The history of this earth would still do difficult moments with occasion of the war between the Pamplona king and Ramiro I of Aragon, both siblings and successors of Sancho el Mayor who had separated the Aragonese territory of that of Navarrese one, for its testament, transforming it into Kingdom. In that campaign this village will see pass to the Aragonese army, in 1043, on the way to Biel and Tafalla, putting an end to a possible Navarrese dominance on the western area of the Gállego.
From 1033, for designs of Sancho el Mayor , Aguero will be one of the Aragonese holdings that defend this Kingdom in the area of the Gállego river. A holding that -adapted to the natural accidents of the country - responded to a group of castles in the Guillén, Coal and Valdelosica mountains, that is to say, to Uncastillo, Luesia, Biel and Murillo. This frontier holding will be centered in the castle of Agüero that will be the base of the military cortege of the tenente or seníor and it will have a small territory surrounding, of the one that the 'señor' will take out tributes to sustain the place.
The first tenente would be Jimeno lñiguez, to who would succeed his son Fortún before 1036. In the year 1068 will be Fortún Iñigones like «second lieutenant, in Agüero and in Riglos». September 4, 1092 will already occupy the holding Fortún López, «second lieutenant, in Agüero and in Riglos». These data make us detect the coincidence that, in the XI century, two tenentes of Agüero are part of the Aragonese real court as soon as that they occupy second lieutenant position. This position had to be occupied by people of good lineage, since it corresponded the second lieutenant to guide the real army when the king didn't go to the war. This fact, very curious, takes us to think at a family of tenentes of Agüero that occupy real second lieutenant position, that is, to the position of some border holdings of importance.
In view of the documents of the time it is seen that the time of Agüero
and their Mallos are understood geographically as a defined area and with own personality; a border district in which have properties illustrious Aragonese figures at the moment. Curious it is to this respect the testament that Oriol lñíguez and his wife make, before beginning a pilgrimage in 1057, for which we know that they had two houses: one in Abós and another in Agüero, with eleven beds, a bed with pavilion, twenty-two mattresses, a silk spread, a blanket, two couples of lined sheets, six silver glasses, skins, swords, spurs, belt and silver mount, iron helmet and layer of ubaidí silk to close the military attire. All this will finish being property of San Juan de la Peña, for donation of a son of these called Fortuño Oriol.
On this defined geographical entity it will be born and it will live the a curious Kingdom of the Mallos, a minuscule state that will have their institucionalización for work of Pedro I of Aragon and their brother's tolerance Alfonso I the Batallador (Fighter). Its king will be a woman: the queen doña Berta, an Italian that got married with the king Pedro I, in the cathedral of Huesca, on Sunday August 16, 1097.
With occasion of the regal wedding, D. Pedro endowed his wife with a small territory and with some goods located in Huesca, Sangarrén and an almunia (a little village) located between Berbegal and Monterroyo.
With these territories would be formed a minuscule state in the limits of the Aragonese mountain. They will be part of it, the places of Agüero, Murillo, Riglos, Marcuello and Ayerbe, completing them the territories of Sangarrén and Callén, separate unit and located in the Valley oscense and beside the Flumen river.
After emitting several documents, made by the queen's scribe -the chaplain Juan -, we can know that the queen doña Berta governed «under my gentleman's grace the king D. Pedro that is already dead, and with the love of the this one my brother-in-law», Alfonso. One of these documents, of 1105, speaks to us that doña Berta granted to the bishop Esteban the novena that accustomed to give San Félix's residents: 'that the beasts graze in the mounts of Agüero and that, those, cut firewood, wood, acorns and, besides other things, grass'.
The Kingdom of the Mallos, centered in the territory of Agüero, will disappear around the year 1110. An ephemeral life for the domain of a woman that exercised of queen -unique case- inside the lands of the Kingdom of Aragon and existing a nominal king of the throne of the Ramírez one. Changes of the destination, the Kingdom was being shrunk in its scanty territories until passing totally to the crown of El Batallador who, after finishing with this political anomaly, he gave the military district to Castañ, a frank figure, friend of the Aragonese king's childhood who will still govern the place in 1137 after dying his protector.
Castañ, also known as Castán of Biel, governs Agüero, Biel, Aniés, Chalamera, Murillo de Gállego and Riglos from 1110. In 1134 he still possesses the holding of Murillo and in 1137 he has those of Riglos and Agüero. To this Loferrench will succeed him, who would be tenente and gentleman of Agüero between April of 1155 and October of 1162. Then it would also occupy the dominion of Luna, concretely between 1162 and 1172.