From a land-owning family, Herrera studied at the University of San Carlos of Guatemala, where he earned a law degree[1] and came in contact with the liberal ideas of the French Revolution. He was a tutor of his nephew, General Morazán.
Public office
In 1820 he occupied his first public office, as secretary of the town government of Tegucigalpa. On 16 September 1824 he became the first head of state of Honduras, after the independence of Central America from Spain and from Mexico. Colonel José Justo Milla was his vice-head of state. During his term he decreed the first territorial subdivisions of Honduras, creating the departments of Comayagua, Tegucigalpa, Santa Bárbara, Yoro, Olancho and Choluteca (department). He also promulgated the first constitution of the country (state), on 11 December 1825.
The government of Herrera was overthrown on 10 May 1827 in a coup d'état led by Colonel Milla and aided by Honduran Conservatives. Herrera was sent as a prisoner to Guatemala, where he remained until 1829.
Thereafter he was elected head of state of Nicaragua, taking office on 12 May 1830. He exercised this office until November 1833, relying on the support of General Morazán. He tried to implement various Liberal reforms, but unsuccessfully, due to the opposition of the clergy. In 1835 he was elected head of state of El Salvador, but he declined the office. In 1838 he retired from politics, working as a teacher in the city of San Vicente, El Salvador. He remained there until his death in 1850.