The Upper Peru region (present-day Bolivia), was again under royalist control after the rebel defeat at Huaqui, where the inexperienced commander Juan José Castelli was easily defeated by the royalist army.
The orders from the First Triumvirate had placed Belgrano in command of the Army of the North on 27 February 1812, headquartered in Jujuy. From there Belgrano attempted to raise the morale of the troops after the defeat at Huaqui. Under that effort on 25 May he raised in Jujuy the new flag he had created a few months back, and had it blessed in Jujuy's Cathedral by Father Juan Ignacio de Gorriti.
He soon realized that he did not have enough strength to defend the city, and on 23 August he ordered a massive retreat of all the civilian population to the interior of Tucumán Province in what was later known as the Éxodo Jujeño. Civilians and military men retreated, destroying anything that could be of value to the royalists. When the Spaniards entered the city, they found it empty:
"It was deserted and in ruins, and I was horrified of the sad image of those empty houses and those silent streets after the joyful images from times gone by."
Tristán wrote to his superior, Perú's viceroy, José Manuel de Goyeneche:
"Belgrano cannot be forgiven...".
On orders from the Triumvirate, the Army of the North had to create a stronghold in Córdoba. Instead, Belgrano had the idea of stopping farther north in Tucumán, where the local population was eager to support the army. The 3 September victory at the Battle of Las Piedras between his rearguard and two advance royalist columns confirmed his ideas. He captured the column commander, Colonel Huici and about twenty soldiers. He sent Juan Ramón Balcarce towards the city, ordering him to recruit and train a cavalry troop from the local militia, and deliver letters to the rich and powerful Aráoz family, one of whose members, Lieutenant Gregorio Aráoz de Lamadrid, was among Belgrano's best officers.
Balcarce's mission, along with the rumours that his army was retreating to Córdoba, caused consternation in the city. The Cabildo bells rang and the legislature, in public session decided to send three representatives – officers Bernabé Aráoz and Rudecindo Alvarado and the priest doctor Pedro Miguel Aráoz — to Belgrano, to ask that he face the Spanish at Tucumán. Arriving in Tucumán on 13 September, Belgrano met Balcarce with 400 men – without uniforms and with only lances for weapons, but well organized – and the city ready to support them. Belgrano, historians say, did not need more than that pretext to disobey the Triumvirate's retreat orders and stay. He said he would stay if they supplied him with 1,500 cavalry troops, and if they gave him 20,000 silver pesos for the troops, amounts that the legislature decide to grant. Therefore, he ignored the Triumvirate's orders of retreat and instead entrenched in Tucumán.
At the same time, the royalist army had difficulty advancing, not finding in the scorched earth tactics supplies or places to stay and rest. Local irregulars organized by the militias were harassing them constantly. On 23 September, Tristán received the news that the rebel army was in the city and ready for battle.
In the morning of the 24th, Tristán ordered a march towards the city. Sources say that instead of taking the straight road in, he rounded the central plaza from the South, attempting to prevent a possible rebel movement towards the South. Others say that in the village of Los Pocitos he found burning fields ordered by Dragoons Lieutenant Lamadrid, who counted on the fierceness of the fire and the wind to disorganize the Spanish column.
In the meantime, taking advantage of the confusion created by the fire, Belgrano, who had placed his troops in the very early morning at the North side of the town, had changed his front facing West, counting on having a clear image of Tristán's troop movements. Once he saw them, the quick advance over Tristán's flank barely gave him time to reorganize his front and mount the artillery formation.
Belgrano had organized his cavalry in two wings; the right, commanded by Balcarce, was the bigger of the two, as it included the local gaucho troops recently recruited.
The infantry was divided in three columns, commanded by Colonel José Superí on the left, captain Ignacio Warnes at the center, and Captain Carlos Forest on the right, plus a section of Dragoons, supported the cavalry. A fourth reserve column commanded by Lieutenant-Colonel Manuel Dorrego; and Baron Eduardo Kaunitz of Holmberg (who commanded the artillery), was placed between the infantry columns, but was too divided to be effective.
The artillery initiated the battle, bombarding the Cotabambas and Abancay battalions, who responded with a bayonet charge. Belgrano ordered a response by having Warnes charge with his infantry, along with the cavalry reserve of Captain Antonio Rodríguez, while Balcarce's cavalry charged over Tristán's left flank. The charge had a formidable effect. With lances pointed, and making loud sounds and shouts, they made the royalist cavalry of Tarija disband at their charge, retreating over their own infantry and disorganizing it to the point that, almost without resistance, the rebel cavalry reached the enemy's rearguard.
It is impossible to know what effect charging from there in a pincer movement would have had with a rebel force composed of country folk without military discipline. A good portion of the gaucho cavalry broke formation to capture the mules loaded with supplies, including coins and precious metals from the royalist army. They therefore negated their use of supplies and ammunition. Only the Dragoons and regular cavalry under Balcarce stayed in formation at the front, but the loss of their supplies and baggage was enough to disorganize the royalist wing.
On the other side of the front the results were very different where Belgrano was fighting. The royalist's cavalry and infantry advance was unstoppable, with Colonel Superí being taken as prisoner. Even though the strength of the central column allowed the rebels to regain terrain and release Superí, the unequal advances fractured the front, creating a confused battle. The commanders had trouble seeing what was happening and often the decisions were taken by the local unit officers in the heat of battle. At that time a swarm of locusts appeared on the fields, which obscured the battlefield and confused the soldiers.
Tristán attempted to retreat to organize his troops, abandoning his artillery, and in the course found Dorrego's column, virtually unprotected. Along with a troop of infantry of Eustaquio Díaz Vélez, they recovered thirty nine wagons loaded with arms and ammunition which were taken to the city, along with the cannon they could push. The rebels also took many prisoners and the flags of the Cotabambas, Abancay and Real de Lima regiments.
Belgrano, at the time not knowing the result, was attempting to reorganize his troops when he found Colonel José Moldes, who was his main observer. Both then found Paz, and through him what remained of the cavalry. Balcarce joined them a while later, being the first to be bold and qualify the battle as a victory, judging by the body-covered field and Spanish equipment remains, even though they did not yet know the fate of the main infantry regiments and what was happening inside the city. It took General Belgrano the rest of the afternoon to reorganize the troops.
At the same time, Tristán was evaluating the loss of his ammunition, most of his artillery and supplies; he ordered the rest of his army, which had lost more than a thousand men between dead and wounded, to form and advance on the city and demand their surrender under threat of burning it. Díaz Vélez and Dorrego, strong in the city by now, responded by threatening to kill the prisoners, including four colonels, if Tristán set fire to the city.
The Spaniard spent the night outside, in doubt over the course to follow; the following morning he found Belgrano's troops at his rear, who demanded his surrender through Colonel Moldes. The royalist commander responded that "the King's soldiers do not surrender", so Tristán retreated towards Salta, while being followed and harassed by 600 men commanded by Díaz Vélez.
"Even though the victory at Tucumán", writes Mitre, "was the result of unforeseen circumstances", it earns Belgrano "the glory of having won a battle against all probabilities and against the wishes of his own government."
The materiel abandoned by the Spaniards —13 cannons, 358 muskets, 39 wagons, 70 ammunition boxes and 87 tents— would serve the Army of the North in the subsequent campaign. 450 royalists lost their lives in combat and 690, between officers and soldiers, were captured as prisoners. On their side, the defenders only had 80 dead and 200 wounded.
On 27 October they celebrated a thanksgiving mass; in the procession that carried the statue of the Virgen de las Mercedes (Our Lady of Mercy), Belgrano deposited his command baton, proclaiming the saint as General of his Army.
Moldes and Holmberg would leave the army, but Belgrano would gain Juan Antonio Álvarez de Arenales, with whom he would start on 12 January the march towards Salta, where the royalists had entrenched.
The victory consolidated the work of the revolution and momentarily ended the danger of a disaster for the rebel forces. If the patriot army would have retreated as ordered, the North Provinces would have been lost to the enemy whom, controlling a vast territory, would have reached Córdoba, where it would have been easier to receive the help from the royalists at the Banda Oriental (today's Uruguay) and the Portuguese troops from Brazil.
The victory also had important political consequences, as Belgrano – who had allies in the Logia Lautaro — had defeated the invader against orders from his government and vindicated the requests of the opposicion, when they asked for help to be sent to the Army of the North. In Buenos Aires, three days after the victory was known, the First Triumvirate was overthrown in the revolution of 8 October.
The Second Triumvirate allowed the army soldiers to wear a medal with the inscription: "La Patria a su defensor en Tucumán" ("The Motherland to the defenders of Tucumán"); and also ordered that the names of the soldiers be inscribed in the book of honor of the respective Cabildos of Buenos Aires and Tucumán. Belgrano was offered a promotion to Captain General, but he declined the honor.