Like the rest of Central America, Costa Rica never fought for independence from Spain. On 15 September 1821, after the final Spanish defeat in the Mexican War of Independence (1810–21), the authorities in Guatemala declared the independence of all of Central America. That date is still celebrated as Independence Day in Costa Rica even though, technically, under the Spanish Constitution of 1812 that had been readopted in 1820, Nicaragua and Costa Rica had become an autonomous province with its capital in León.