During the war of independence, the city became a commercial and military strategic point between Perú and the Argentine cities. Between 1816 and 1821, the city was led by local military leader General Martín Miguel de Güemes, who under the command of General José de San Martín, defended the city and surrounding area from Spanish forces coming from further north.