costa rica never fought for independence from spain. on september 15, 1821, after the last 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.