Castelli was not well received in Córdoba, where Liniers was popular, but he was in San Miguel de Tucumán. In Salta, despite a formal good reception, he had difficulty obtaining troops, mules, food, money, or guns. He took political leadership of the expedition to Upper Peru, displacing Hipólito Vieytes, and replaced Ocampo with Colonel Antonio González Balcarce. He was informed that Cochabamba revolted in support of the Junta, but was threatened by royalist forces from La Paz. Castelli intercepted a letter from Nieto to Gutiérrez de la Concha, governor of Córdoba, who was already executed for his support of Liniers. This letter mentioned a royalist army led by Goyeneche marching to Jujuy. Balcarce, who had advanced to Potosi, was defeated by Nieto in the Battle of Cotagaita, so Castelli sent two hundred men and two cannon to strengthen his forces. With these reinforcements, Balcarce achieved victory at the Battle of Suipacha, which allowed patriots to control all of Upper Peru unopposed. One of the men sent was Martín Miguel de Güemes, who would eventually lead the "Guerra Gaucha" in Salta years later.