Childhood and early life
Maroto was born in the town of Lorca in the Region of Murcia, Spain, to Margarita Isern, a native of Barcelona, and Rafael Maroto, a native of Zamora. His father was a military captain who held several important positions in civilian life, such as acting as an administrator for the Visitador de Rentas in Lorca.
Maroto was baptized in the San Cristóbal parish church, where his baptismal certificate was preserved and later helped biographers clarify details of his family. During his childhood, he lived on the Calle Mayor (Main street) of the Barrio de San Cristóbal, across from Plaza de la Estrella. He married Antonia Cortés García, a Chilean, in 1816, and had seven children with her. Antonia and two of his daughters died in a shipwreck in 1830 en route to Chile.
At the age of 18, Maroto took part in the conflicts and campaigns of Manuel de Godoy, which were collectively known as the War of the Oranges. He also fought in the Spanish War of Independence, in which he was wounded and made a prisoner in Zaragoza. He then received a position in Peru and later fought in the war against the pro-independence Chileans. However, he was defeated by General José de San Martín in the Battle of Chacabuco (1817). In Spain, he also participated in the First Carlist War and was one of the signers, along with liberal general Espartero, of the Convention of Vergara (Convenio de Vergara, also called the Abrazo de Vergara: "embrace of Vergara"), which ended the civil war between Carlists and the Isabelinos with the victory of the latter.