In 1844 he became President and put in place the new Constitution drafted by the Assembly in March 1844. He was opposed by sectors of the Army, led by the military commander general of Costa Rica, General Pinto. After the coup failed, Bonilla removed Pinta from the army. 