He was taken prisoner during the Paraguay campaign at Tacuarí, and was later released rejoining the forces that later would fight in the Army of the North campaigns under general Belgrano. Warnes distinguished himself at the battles of Tucumán and Salta, when the army attempted the liberation of Upper Peru (present-day Bolivia). He also fought with distinction in the defeats of Vilcapugio and Ayohuma.