The Republicans won the battle and San José became capital of the country, which remained independent within the Federal Republic of Central America.
[3] Costa Rica was isolated from the outside world, and it took a month for news to arrive of the Act of Independence of Central America proclaimed on the 15 September 1821 in Guatemala.
[3] Gregorio José Ramírez, who had represented the province of Alajuela in the council that decided on the independence of Costa Rica, was hostile to joining the empire.
[4] By March 1823 the Superior Governing Council of Costa Rica had still not declared allegiance to the emperor, and the conservatives decided to stage a coup.
[2] Rafael Francisco Osejo, who had always favored the independence of Costa Rica, was made president of the triumvirate government formed in Cartago in March.
[4] On 29 March 1823 a group of Cartago residents led by Joaquín de Oreamuno occupied the army barracks and proclaimed that Costa Rica would join the Mexican Empire.
[2] There was an attempt to negotiate, but that quickly broke down and both sides began firing their muskets from the cover of the large volcanic rocks that litter the area.
Sergeant Félix Oreamuno y Jiménez took command and asked for a ceasefire, but Ramírez insisted on unconditional surrender and continued to fight until the forces of Cartago were completely defeated.
A year later after the Guerra de la Liga the position of San Jose was confirmed, and this was made official in 1837 by head of state Braulio Carrillo Colina.