Compostela became capital of Galicia in the 11th century. The independence of Portugal (1128) made its southern boundary. The accession of the Castilian King Ferdinand III to the Leonese kingdom in 1230 brought Galicia under the control of the Crown of Castile. The kingdom of Galicia was now a political division in the larger realm.