The Battle of Ayacucho (, ) was a decisive military encounter during the Peruvian War of Independence. This battle secured the independence of Peru and ensured independence for the rest of South America. In Peru it is considered the end of the Spanish American wars of independence in this country, although the campaign of Antonio José de Sucre continued through 1825 in Upper Peru and the siege of the fortresses Chiloé and Callao eventually ended in 1826. As of late 1824, Royalists still had control of most of the south of Peru as well as of the Real Felipe fortress in the port of Callao. On 9 December 1824, the Battle of Ayacucho (Battle of La Quinua) took place between Royalist and Independentist forces at Pampa de Ayacucho (or Quinua), a few kilometers from Ayacucho, near the town of Quinua. Independentist forces were led by Simón Bolívar's lieutenant Antonio José de Sucre. Viceroy José de la Serna was wounded, and after the battle second commander-in-chief José de Canterac signed the final capitulation of the Royalist army. The modern Peruvian Army celebrates the anniversary of this battle. Background In January 1820, Spain underwent a political upheaval, beginning with a revolt against the king, Ferdinand VII. An expedition of 20,000 soldiers was to be sent to Río de la Plata (roughly the present-day territories of Argentina, Chile, Bolivia, Paraguay and Uruguay) to help the royalists of America, but instead they revolted with the encouragement of General Rafael Riego. In the subsequent weeks the revolt spread, and King Ferdinand was forced to restore the liberal Spanish Constitution of 1812, which he had suppressed six years earlier. The revolt meant Spain no longer had reinforcements to send to America, which in turn eventually forced the royalist armies of the viceroyalties of Peru and New Spain (today's Mexico), which had held back the Spanish American revolution until then, to deal with the patriot forces on their own. The royalists in each viceroyalty, however, took different paths. In New Spain, after the royalists defeating the insurgents, they proclaimed a negotiated separation from Liberal Spain to create a new monarchical state. This was done 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ú. Further south, however, the absence of reinforcements due to Riego's revolt allowed Patriot forces to