[1] He fell from power in April 1839 after he lost the Battle of Espíritu Santo and his position was taken by Casto Fonseca, who ruled until his death in 1845, and was replaced by José Trinidad Muñoz.
They instructed him to arrest the Head of State, José Zepeda, Colonel Román Valladares, Deputy Pascual Rivas and Captain Evaristo Berríos.
Deputy Head of State, José Núñez, assumed leadershipto finish Zepeda's term, which had two years left.
Núñez did not arrest the rebels, but rather appeased Méndez and on 26 January appointed him General Commander of Arms, but Braulio Mendiola was executed.
[1] The Salvadoran army under the command of Francisco Morazán defeated the Nicaraguan army at the hacienda Espíritu Santo on 6 April 1839, returning Méndez to León where he was removed from office, replaced by Casto Fonseca, and imprisoned in San Juan del Norte under the responsibility of the Political Chief of Granada, Narciso Espinosa.