This coincided with a great Peruvian constitutionalist movement; Gamarra put aside the Constitution of 1828, which he opposed given the limitations that were established for the executive branch.
During such expeditions he would leave the presidency to Antonio Gutiérrez de la Fuente, who manifested his authoritarian character and started to receive the enmity of other government officials based in Lima.
In 1835, when Orbegoso and Andrés Santa Cruz signed the treaty to establish the Peru-Bolivian Confederacy, Gamarra deeply opposed it and participated in a campaign to defeat it with the help of Chile.
From January to October 1839 the Chilean troops of General Manuel Bulnes were stationed in Lima to stabilize Gamarra's new regime.
[2] During his second government, Gamarra confronted the challenge of pacifying the country in middle of various subversions while at the same time the beginning of a war against Bolivia.