As a delegate for the Junta, he led the ill-fated Paraguay campaign. His troops were defeated by Bernardo de Velasco at the battles of Campichuelo and Paraguarí. Though he was defeated, the campaign initiated the chain of events that led to the Independence of Paraguay in May 1811. He retreated to the vicinity of Rosario, to fortify it against a possible royalist attack from the Eastern Band of the Uruguay River. While there, he created the flag of Argentina. The First Triumvirate did not approve the flag, but because of slow communications, Belgrano would only learn of that many weeks later, while reinforcing the Army of the North at Jujuy. There, knowing he was at a strategic disadvantage against the royalist armies coming from Upper Peru, Belgrano ordered the Jujuy Exodus, which evacuated the entire population of Jujuy Province to San Miguel de Tucumán. His counter-offensive at the Battle of Tucumán resulted in a key strategic victory, and it was soon followed by a complete victory over the royalist army of Pío Tristán at the Battle of Salta. However, his deeper incursions into Upper Perú led to defeats at Vilcapugio and Ayohuma, leading the Second Triumvirate to order his replacement as Commander of the Army of the North by the newly arrived José de San Martín. By then, the Asamblea del Año XIII had approved the use of Belgrano's flag as the national war flag.