He was appointed lieutenant colonel in 1796, leading a local militia from that year to 1802. When he left, he granted all his military wages from that period to the soldiers of his unit. He was appointed colonel on March 24, 1802, and donated $2,435 for the clothing of the soldiers. He further donated $1,000,000 to build a navy, along with Juan Larrea and Domingo Matheu. He fought in the 1806 British invasions of the Río de la Plata, commanding a last stand on the Gálvez bridge. His men manage to hold their position for 20 hours, with only 400 soldiers, against a much larger British force. He eventually was forced with withdraw with only 50 soldiers remaining, and proceeded to join forces with the brigadier Hilarión de la Quintana.