Central America
After the fall of the Mexican Empire in 1823, representatives of the former Spanish provinces on the Central American isthmus declared independence. The constitution of 1824 joined Guatemala, El Salvador, Honduras, Nicaragua and Costa Rica in a federal republic. Each state retained its own government, while the federation elected a president.
In 1837 a cholera epidemic in Guatemala helped turn rural opposition to the state’s liberal government into an armed revolt led by Rafael Carrera. Federal president Francisco Morazán intervened in Guatemala as his authority elsewhere on the isthmus crumbled. Nicaragua, Honduras and Costa Rica withdrew from the federation in 1838. Morazán tried to retake Guatemala City in 1840, but Carrera drove his army out. El Salvador, which had continued to support the union, declared itself sovereign in 1841.