He was born in Ferrol, Galicia. In 1812, he was enrolled at the military academy in Santiago de Compostela, where he assisted his father, who was a professor there. He went to Madrid in 1820 to study at the "Reales Estudios de San Isidro" (now part of the Colegio Imperial de Madrid). Three years later, he went to Cádiz to enlist in the army fighting the "Hundred Thousand Sons of Saint Louis" sent by the Duke of Angoulême. He was wounded and briefly held as a prisoner of war. Afterwards, he remained there to study at the "Escuela de Bellas Artes".