By that time, the tide of the wars of independence in South America had turned decisively against Spain: Simón Bolívar's victory at the Battle of Boyacá (August 7, 1819) had sealed the independence of the former Viceroyalty of Nueva Granada, while to the south, José de San Martín, after landing his Army on the Peruvian coast on September 8, 1820, was preparing the campaign for the independence of the Viceroyalty of Perú.