The Federal Republic of Central America (Spanish: República Federal de Centroamérica), also called the United Provinces of Central America (Provincias Unidas del Centro de América) in its first year of creation, was a sovereign state in Central America consisting of the territories of the former Captaincy General of Guatemala of New Spain. It existed from 1823 to 1841, as a republican democracy.
The republic consisted of the present-day Central American countries of Costa Rica, El Salvador, Guatemala, Honduras, and Nicaragua, and the southern Mexican state of Chiapas. In the 1830s, a sixth state was added - Los Altos, with its capital in Quetzaltenango - occupying parts of what are now the western highlands of Guatemala and Chiapas.
Shortly after Central America declared independence from the Spanish Empire in 1821, some of its countries were annexed by the First Mexican Empire in 1822 and then Central America formed the Federal Republic in 1823. From 1838 to 1840, the federation descended into civil war, with conservatives fighting against liberals and separatists fighting to secede. These factions were unable to overcome their ideological differences and the federation was dissolved after a series of bloody conflicts.