He returned to Guatemala City in 1921 to participate in a coup that installed General José Orellana into the presidency, after the sitting president Carlos Herrera y Luna refused to ratify the concessions that Estrada Cabrera had made to the United Fruit Company. Under Orellana he was appointed Secretary of War in 1922, but quit a year later. In 1926, after the death of President Orellana, Ubico ran unsuccessfully for president as the candidate of the Political Progressive Party. He temporarily retired to his farm until the next election.