Costa Rica joined other Central American provinces in 1821 in a joint declaration of independence from Spain. Although the newly independent provinces formed a Federation, border disputes broke out among them, adding to the region's turbulent history and conditions. Costa Rica's northern Guanacaste Province was annexed from Nicaragua in one such regional dispute. In 1838, long after the Central American Federation ceased to function in practice, Costa Rica formally withdrew and proclaimed itself sovereign. | Costa Rica joined other Central American provinces in 1821 in a joint declaration of independence from Spain. Although the newly independent provinces formed a Federation, border disputes broke out among them, adding to the region's turbulent history and conditions. Costa Rica's northern Guanacaste Province was annexed from Nicaragua in one such regional dispute. In 1838, long after the Central American Federation ceased to function in practice, Costa Rica formally withdrew and proclaimed itself sovereign. |