In 1561, the Spanish arrived in Costa Rica and colonized the area. For almost 250 years, it was a Spanish colony. Costa Rica, along with numerous other Central American countries, declared independence from Spain in 1821.