 It was not long before Spanish settlers turned to the hills, where they found rich volcanic soil and a milder climate than that of the lowlands.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.