Battle of Ayacucho own. The royalists in each viceroyalty, however, took different paths. In New Spain, royalists, after defeating the insurgents, proclaimed a negotiated separation from Liberal Spain through the Plan of Iguala, which they negotiated with the remaining patriots, and the Treaty of Córdoba, which they negotiated with the new head of government, Juan O'Donojú. In Peru Viceroy Joaquín de la Pezuela was discredited after a royalist expedition to Chile under Mariano Osorio was defeated and advances in Peru were made by José de San Martín. The viceroy was overthrown on 29 January 1821, in Asnapukyu "(Aznapuquio)", in a coup by General
Battle of Ochomogo Battle of Ochomogo The Battle of Ochomogo (5 April 1823) was fought in Ochomogo, to the west of Cartago, Costa Rica, shortly after the country became independent from Spain. Republican militia from San José and Alajuela led by Gregorio José Ramírez defeated conservative forces from Cartago, the capital, who supported making Costa Rica part of the new Mexican Empire. The Republicans won and San José became capital of the country, which remained independent within the Federal Republic of Central America. Cartago was the first Spanish settlement in Costa Rica, founded in 1563 by Juan Vázquez de Coronado. It was the