 After annexation of Ribagorza and Sobrarbe, Ramiro began the advance from Aragon toward Huesca and Zaragoza.The first charter for the royal town of Jaca is attributed to him.It included well defined laws of protection even to non residents, and would set an example for urban rights until late in the Middle Ages.