But his career was far from over. He fought the French in 1838, losing a leg in battle, and led the Mexican army to defeat in the U.S.-Mexican War. He remained in and out of the Mexican limelight — sometimes in exile — until retiring in 1874 to write his memoirs in Mexico City. He died on June 21, 1876.