Ermengol VI, Count of Urgell, called el de Castilla, was born in Valladolid, whence his nickname comes.
During his minority, he was under the regency of his grandfather, Pedro Ansúrez, lord of Valladolid, but the real power lies in the hands of Guerau II of Cabrera and Raymond Berenguer III of Barcelona.
With their help, the young count conquers Balaguer from the Moors in 1106 and makes it his capital; it will remain so for subsequent counts of Urgell.