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
Juan Bautista de las Casas was quickly revolutionized. There was little resistance in Nacogdoches, where the presidio commander was arrested, or in La Bahia. Las Casas promptly confiscated property belonging to Spanish residents, proclaimed himself the head of a provisional government, released political prisoners and jailed royalists. His arbitrary rule disenchanted much of the army, and they soon teamed together with the remaining royalists. Juan Manuel Zambrano, the subdeacon of San Antonio, soon led a counter-insurgency against him. On March 2, Zambrano and his royalists marched on the government house, captured and arrested Casas and Ignacio Aldama, (Hidalgo's ambassador to the United States). Las Casas