The events at El Callao extended the war until 1826, and had the immediate result that Lima was occupied by José de Canterac. It is said that had there been military action against Bolívar on 26 May, it "would have given the final blow to independence in this part of America". Olañeta's rebellion At the beginning of 1824, the entire royalist army of Upper Peru revolted, led by royalist Pedro Antonio Olañeta, against the liberal Viceroy of Peru, after receiving the news that the constitutional government had fallen in Spain. King Ferdinand VII of Spain and his absolutist followers recovered control of the government, supported by 132,000 French soldiers from the Holy Alliance army, and they would control Spain until 1830. Rafael del Riego was hanged on 7 November 1823, and the other leaders of the liberal movement were executed, outlawed, or exiled from Spain. On 1 October 1823, Ferdinand decreed the abolition of everything approved during the prior three years of constitutional government, which included annulling the appointment of La Serna as viceroy of Peru. The purge of the constitutionalists of Peru seemed absolute. Olañeta then ordered an attack of the Upper Peruvian royalists on the constitutionalists in the Peruvian viceroyalty. La Serna changed his plans and went to the coast to fight Bolívar. He sent Jerónimo Valdés with 5,000 men across the Desaguadero River, which he did on 22 January 1824, in order to drive them to Potosí against his former subordinate "because there are indications of a meditated treason, joining the dissidents of Buenos Aires". Memorias para la historia de las armas españolas en el Perú ("Memories of the history of the Spanish armies in Peru") by peninsular official Andrés García Camba (1846) detailed the radical change that the events in Upper Peru produced in the viceroy's defensive plans. After the battles of Tarabuquillo, Sala, Cotagaita, and finally La Lava on 17 August 1824, the royalist forces of both the Viceroyalty of Peru (liberals) and of the provinces of Upper Peru (absolutists) were decimated. Bolivar, hearing of Olañeta's actions, took advantage of the dismantling of the royalist defences and "moved the whole month of May to Jauja", to face José de Canterac, who was isolated in Junín on 6 August 1824. Unrelenting prosecution of the war began, and 2700 royalists deserted and went over to the independentists. On 7 October 1824, with his troops before the gates