The Peruvian War of Independence was composed of a series of military conflicts in Peru beginning with viceroy Abascal military reconquest in 1811 in the battle of Guaqui, going with the definitive defeat of the Spanish Army in 1824 in the battle of Ayacucho, and culminated in 1826, with the Siege of Callao. The wars of independence took place with the background of the 1780–1781 uprising by indigenous leader Túpac Amaru II and the earlier removal of Upper Peru and the Río de la Plata regions from the Viceroyalty of Peru. Because of this the viceroy often had the support of the "Lima oligarchy," who saw their elite interests threatened by popular rebellion and were opposed to the new commercial class in Buenos Aires. During the first decade 1800s Peru had been a stronghold for royalists, who fought those in favor of independence in Perú, Upper Peru, Quito and Chile. Among the most important events during the war was the proclamation of independence of Peru by José de San Martín on July 28, 1821.