 He was involved in numerous actions, including the capture of Bayonne in February 1814.He continued serving in the army, and in 1820 he was named deputy to the Cortes (parliament) for Michoacán.On learning of the successful conclusion of Mexico's war of independence, he returned to that country in 1822.