On 9 December 1824, the Battle of Ayacucho, or Battle of La Quinua, took place at Pampa de La Quinua, a few kilometers away from Ayacucho, near the town of Quinua. This battle — between royalist (Spanish) and nationalist (republican) troops — sealed the independence of Peru and South America. The victorious nationalist forces were led by Antonio José de Sucre, Bolívar's lieutenant. Viceroy Serna was wounded and taken prisoner. The Spanish army had 2,000 dead and wounded and lost 3,000 prisoners, with the remainder of the army entirely dispersed. After the battle, Serna signed the final capitulation whereby the Spaniards agreed to leave Peru. Serna was released soon afterwards and sailed for Europe.