 Subsequently, Costa Rica was part of the Federal Republic of Central America in 1813, before gaining full independence in 1821.Its economy struggled due to lack of connections with European suppliers.In 1856, Costa Rica resisted United States settlers from mounting a take-over of the government.