 He and Agnes had a daughter, Petronilla, who was betrothed to Count Ramon Berenguer IV of Barcelona at the age of one.The marriage contract, signed at Barbastro on 11 August 1137, made Petronilla the heir to the crown of Aragon, which in event of her childless death would pass to Ramon Berenguer and any children he might have by other wives.Ramon accepted Ramiro as "King, Lord and Father", and the County of Barcelona and the Kingdom of Aragon were united into the Crown of Aragon.