The local Montoneros guerrillas surrounded the town and Ramírez's troops. Tarija's chieftains had more than 1000 men ready for battle. Lieutenant Colonel Aráoz de Lamadrid, was arriving with nearly 500 men from Argentina's territory to the South with a regiment of Hussars and militias from Tucumán. Nearing Tarija he learned that the local forces were harassing Ramírez's troops, and going down the hills at Tolomosa, he arrived in the town encountering Méndez, an old acquaintance of the Argentine chief. Lamadrid, with his small force was at the time in battle with the enemy. With Méndez' arrival they vanquished the royalist left flank, while Lamadrid attacked in the center, with a victory making the royalists flee. The Army of the North and the local militias took control of Tarija itself.[2]
Afterwards, the revolutionaries returned to the camp where their Argentine commander released the prisoners obtaining Ramírez's surrender along with other royalist officers, among them Andrés de Santa Cruz, who later would switch sides by joining the revolutionary forces in Peru.