List of heads of state of Costa Rica

First independent governments (1821–1824)

On October 11, 1821, the province of Costa Rica proclaimed its absolute independence from Spain. On the 29th of that month, the city of Cartago, head of the Partido de Costa Rican, also signed an act declaring the absolute independence of the Spanish Government.

During this period the main divisions occurred between two sides; the imperialist who sought to annex Costa Rica to the First Mexican Empire and the Republican who sought full independence from Costa Rica. The monarchicals or monarchists also advocated the recognition of Agustín de Iturbide as emperor.

{{center| 
Political chief of the Province of Costa Rica<ref name="Clotilde"

      Republicans       Imperialists

 
Juan Manuel de Cañas Political chief October 11, 1821 – November 12, 1821 Españolista
 
Nicolás Carrillo y Aguirre President of the Town's Legates Junta November 12, 1821 – December 1, 1821 Imperialist
 
Pedro José de Alvarado y Baeza President of the Provisional Government Junta December 1821– January 1822 Imperialist
 
Rafael Barroeta y Castilla President of the Electors Board January 6–13, 1822; president of the Superior Government Junta, January 6 – April 13, 1822 Imperialist
 
Santiago de Bonilla y Laya-Bolívar President of the Superior Government Junta 13 Aprial – June 15, 1822 Liberal
 
José María de Peralta President of the Superior Government Junta June 15 – October 17, 1822 Republican
 
José Rafael Gallegos President of the Superior Government Junta 17 octubre de 1822– January 1, 1823 Imperialist
 
José Santos Lombardo President of the Superior Government Junta January 1 – March 20, 1823 Imperialist
 
Rafael Francisco Osejo President of the Diputación of Costa Rica March 20–29, 1823 Republican
 
Joaquín de Oreamuno General Commander of Arms, de facto March 29 – April 5, 1823 Imperialist
 
Gregorio José Ramírez General Commander of Arms, de facto April 5 – 16, 1823 Republican
 
José María de Peralta President of the Constituent Provincial Congress April 16 – May 10, 1823 Republican
 
Manuel Alvarado e Hidalgo President of the Superior Government Junta 1823–1824 Republican
 
Eusebio Rodríguez y Castro President of the Superior Government Junta January 8 – February 12, 1824 Republican
 
Manuel Alvarado e Hidalgo President of the Superior Government Junta February 12 – September 8, 1824 Republican