In 1871 a liberal revolution ended thirty years of conservative rule in Guatemala and began an era that remade the country around coffee. Under the conservative governments of Rafael Carrera and Vicente Cerna, church leaders and the traditional elite held considerable influence, while cochineal dye was an important export. When synthetic dyes ruined cochineal exports, landowners looked to coffee. The rebels of 1871, led by Miguel Garcia Granados and the general Justo Rufino Barrios, promised order, progress, and integration into the world economy. Barrios consolidated power and ruled as president from 1873 until his death in 1885.
The liberals transformed the relationship between land, labor, and the state. Barrios's government stripped the Catholic Church of its property, expelled the Jesuits, and brought education under state control. Decrees in the 1870s allowed the sale of church estates and communal Indigenous lands, and land passed to coffee planters as foreign investment and German commercial influence grew. The state built telegraph lines and railways to carry coffee to the ports, and Barrios promoted Guatemala City as a modern capital modeled on European ideas of order and hygiene.
Coffee plantations required large workforces, and the liberal state used coercion to supply them. Vagrancy laws and labor drafts forced Indigenous communities in the western highlands to send contingents of pickers to the coastal plantations each season. Land loss and labour obligations reduced the choices available to Indigenous workers. Barrios dreamed of reuniting Central America under liberal rule, but when he tried to impose union by force he was killed at the battle of Chalchuapa in El Salvador in 1885. His successors kept his economic model intact, and coffee came to provide most of Guatemala's export income.
From 1898 to 1920 Manuel Estrada Cabrera maintained a dictatorship while continuing the export-led policies of his predecessors. He granted concessions to the United Fruit Company, including an agreement in 1904 for a railway between Puerto Barrios and Guatemala City. Roads, agricultural production, schools, and sanitation developed alongside political repression. Indigenous labourers remained subject to peonage, and opponents faced imprisonment and violence. Estrada Cabrera fell after an armed revolt in 1920. By 1924 subsequent governments still ruled on behalf of the coffee elite, leaving the concentration of land, labour control, and foreign commercial influence central to national politics.