Ubico received a commission in the Guatemalan army in 1897, distinguished himself in several campaigns, and rose to the rank of colonel. In 1907 he was appointed governor of Alta Verapaz and in 1911 governor of Retalhuleu, where he served with efficiency and honesty. In the following years he was made a brigadier general, a member of the National Assembly, and minister of war (1922–26) under President José María Orellana. In 1931, backed by liberals and progressives, he was elected president of Guatemala, an office he held until 1944.
Ubico restored Guatemala’s international credit, built roads and public works, improved public health, and eliminated wholesale corruption. He also replaced Indian slavery with vagrancy laws, which required that indigenous farmers work an assigned number of hours on certain plantations in order to maintain an equal distribution of workers among landowners. Ubico also established Decree 1816, which essentially made it legal to murder an indigenous farmer who refused to comply with the new laws. Ubico cultivated the friendship of the United States, particularly during World War II, and was rewarded with tariff reductions and armaments. At the same time, he also eliminated all political opposition and democratic activity in Guatemala. Unrest developed, and when Ubico suspended freedom of speech and the press on June 22, 1944, he was overthrown by a popular revolt the following day. He fled the country on July 1 and made his home in New Orleans.