The year 1820 marked a turning point of a long civil war in Argentina, with provinces fighting among themselves and with Buenos Aires, after the fall of the central government following the Battle of Cepeda. Güemes found himself with enemies on two fronts: the royalist troops in the north, and Bernabé Aráoz, governor of Tucumán, in the south. Aráoz had struck an alliance with Salta's rich landowners, opposed to Güemes, and defeated him on 3 April 1821. The Cabildo of Salta, dominated by conservatives, deposed Güemes from the governorship. His gauchos retook power in May. Soon, however, colonel José María Valdés, a Spanish rustler in the service of the royalist army, took advantage of his knowledge of the terrain, promised the landowners to respect their properties, and with their support he occupied Salta again on 7 June. Güemes fled the city, but was shot in the back. He managed to get to his camp at Chamical, gave the last orders to his army and died of his wounds on 17 June. His men retook Salta from the royalists, this time permanently, on 22 July.