Guerra de las Naranjas
In 1793, he enlisted in the military and served as an infantry cadet during the campaign in Roussillon. In October 1799, he was promoted to first lieutenant. During the War of the Oranges in 1801, he took part in a Spanish expedition against Portugal. He also participated in the Peninsular War, during which he was taken prisoner in October 1811. He was appointed by the Duke of Wellington as military governor of Badajoz in 1812. He was colonel of the reunited Regiment of Extremadura at the end of the war in 1815.