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
Republic of Texas by the Spanish governor, Manuel María de Salcedo. Their victory at the Battle of Rosillo Creek convinced Salcedo to surrender on April 1, 1813; he was executed two days later. On April 6, 1813, the victorious Republican Army of the North drafted a constitution and declared the independent Republic of Texas, with Gutiérrez as its president. Soon disillusioned with the Mexican leadership, the Americans under Kemper returned to the United States. The ephemeral Republic of Texas came to an end following the August 18, 1813 Battle of Medina, where the Spanish Army crushed the Republican Army of the North. The