After four years of war, on 28 February 1876, Carlos VII was defeated, and went into exile in France. On the same day, King Alfonso XII of Spain entered Pamplona. After the end of the war, the Basque charters ("fueros/foruak") were abolished, shifting the border customs from the Ebro river to the Spanish coast. In the chartered territories, home rule provisions, left over from the resolution of the First Carlist War, were abolished, and conscription of youth in the Spanish army became compulsory.