He was called upon the following year to provide his services as part of an artillery corps, and he was assigned to the defense of Veracruz, which was still menaced by the remaining Spaniards in the Fortress of San Juan de Ulua.
Carrera was placed in charge of the fortifications and preparing the artillery, and he defended it when Iturbide's troops sieged the city to suppress the Plan of Veracruz against the First Mexican Empire.
He supported the Plan of Jalisco which brought Santa Anna back into power in 1853, and was named by interim President Lombardini, head of the troops at Mexico City.
On the morning of August 9, with Santa Anna already in flight, the government opened one of his last orders handing the power of the executive over to a triumvirate made up of the president of the Supreme Court, Mariano Salas, and Martin Carrera, who once installed were to summon a congress to form a constitution.
[4] The resolution in the capital which had adopted the Plan of Ayutla designated Romulo Diaz de la Vega to choose a junta of representatives from each department and from the federal district, which was to be charged with electing a president of the republic, and to serve as his council of state.
[5] Carrera attempted to abolish the traces of Santa Anna's dictatorship and forbade the commandant generals in charge of the nation's military districts from intervening in treasury matters.
[7] The Carrera government also had to deal with another uprising led by Antonio Haro y Tamariz who on the 13th of August, proclaimed for the downfall of Santa Anna, the abolishment of conscription, freedom of the press, and the summoning of a congress.
[8] The Plan of Ayutla was explicitly liberal, and the Carrera government was viewed as an attempt by the remnants of the Santa Anna regime to co-opt or moderate the revolution.
Faced with the inevitable, Carrera resigned the presidency at 11 in the evening on September 11, leaving the command of the district of Mexico to chief of the garrison Romulo Diaz de La Vega, who at once chose a governing council of seven members.