San Martín was born in the town of Yapeyu, now renamed San Martín in his honor, in the Corrientes province of Argentina, then a Spanish colony. His father was a Spanish official. He was educated at the military academy in Madrid, commessioned as a second lieutenant in 1793, and rose to lieutenant colonel in 1808. He fought with the Spanish army against Portugal, in the African colonies, and against the invasion by Napoleon I's forces. In 1812 he resigned from the Spanish army and sailed home to Argentina, where he offered his services to the revolutionary forces.
He led the rebels to victory over the Spanish forces under General José Zavala at the Battle of San Lorenzo de Parana in February of 1813. San Martín was given the rank of General by the revolutionary government. The following year he took command of Upper Peru (now Bolivia), then at the start of 1817 attacked the Spanish in Chile. With Bernardo O'Higgins he made a triumphal entry into the liberated city of Santiago de Chile on 17 March, 1818.
San Martín next turned his attention to the Spanish stronghold of Peru. After months of slow advances, he won a decisive victory at the Battle of Pisco on 6 December, 1820. The Spanish Viceroy tried to negotiate terms, but as he would not conceed complete independence, San Martín turned him down.
San Martín's portrait appears on the Argentine Peso $5 bill.