Petronila, Petronilla, or Petronella (Aragonese and Catalan:Peronella; Spanish: Patronilla RamÝrez) (1135 – October 17, 1174, Barcelona) was Queen of Aragon from 1137 until 1162. She was the daughter of Ramiro II, King of Aragon, and Agnes of Aquitaine.Petronila came to the throne through special circumstances. Her father, Ramiro, was bishop of Barbastro-Roda when his brother, Alfonso I, died heirless in 1134. As king, Ramiro received a papal dispensation to abdicate from his monastic vows in order to secure the succession to the throne. King Ramiro the Monk, as he is known, married Agnes, daughter of Duke Wiliam IX of Aquitaine and Gascony, and through her produced an heiress, Petronila. At two years old, Petronila was bethrothed to Ramon Berenguer IV, Count of Barcelona and, immediately thereafter, Ramiro abdicated in favour of the count and returned to monastic life.

Ramon Berenguer IV, Count of Barcelonathe Saint (c. 1113 – August 6, 1162) is most known for effecting the union between Aragon and Catalonia.He inherited the county of Barcelona from his father Ramon Berenguer III on August 19, 1131. On August 11, 1137 in Huesca he was betrothed to the infant Petronila of Aragon, aged one at the time. Her father, Ramiro II of Aragon the Monk, who sought Barcelona's aid against Alfonso VII of Castile, abdicated on November 13 that same year, leaving his kingdom to Ramon Berenguer. The latter essentially became ruler of Aragon, although he was never king himself, but instead Count of Barcelona, Prince of the Kingdom of Aragon. He was the last Catalan ruler to use the title of Count as his first; starting with his son Alfonso II of Aragon the counts of Barcelona styled themselves, in the first place, as kings of Aragon.The treaty between Ramon Berenguer and his father-in-law stipulated that their descendants would rule jointly over both realms. Even should Petronila die before the marriage could be consummated, Berenguer would still inherit the title of King of Aragon. Both realms would preserve their laws, institutions and autonomy, remaining legally distinct but federated in a dynastic union under one ruling House.Historians consider this arrangement the political masterstroke of the Hispanic Middle Ages. Both realms gained greater strength and security and Aragon got its much needed outlet to the sea. On the other hand, formation of a new political entity in the northeast at a time when Portugal seceded from Castile in the west gave more balance to the Christian kingdoms of the peninsula.Ramon Berenguer successfully pulled Aragon out of its pledged submission to Castile, aided no doubt by the beauty and charm of his sister Berenguela, wife of Alfonso the Emperor, for which she was well-known in her time. After that, in the middle years of his rule, his attention turned to campaigns against the Moors. In 1147 he helped Castile to conquer AlmerÝa. In 1148 he turned against the lands of the Almoravid taifa kingdom of Valencia and Murcia, capturing Tortosa and, the next year, Fraga, Lleida and Mequinenza in the confluence of the Segre, Cinca and Ebro. The reconquista of the present Catalonia was complete.