Imagine delightful Costa Rica: white-sand beaches, national parks, cloud forests, rain forests, all manner of wildlife, and yoga retreats in idyllic jungle lodges. The Costa Rica of our imagination is also an island of political and social stability, with deep respect for nature, a thriving middle class, and no army.

Nature is still spectacular in Costa Rica, but the rest of the picture is outdated. A national election this month confirmed the country’s embrace of authoritarian politics. Costa Rica has been known for generous spending on health care and education. Now it is planning to build a mass prison modeled on the one in nearby El Salvador that holds tens of thousands of suspected gang members.

Costa Rica has long been the exception in Central America. It remained a remarkably stable democracy while four other countries in the region — Nicaragua, Honduras, El Salvador, and Guatemala — descended into various forms of tyranny. Costa Rica remains a relatively peaceful quasi-democracy, but it seems steadily less exceptional.

Get The Gavel

A weekly SCOTUS explainer newsletter by columnist Kimberly Atkins Stohr.

Four years ago, Costa Ricans elected as president a rabble-rousing populist who had never before held elective office, Rodrigo Chaves. He was ineligible for reelection and nominated his closest aide, Laura Fernández, as his successor. Fernández made clear during her campaign that she would follow his guidance. That propelled her to overwhelming victory on Feb. 1. Leaders of her Sovereign People’s Party have said they will try to maneuver Chaves back to the presidency in four years rather than have him wait the eight years prescribed by the constitution.

Former president Óscar Arias, who won the Nobel Peace Prize in 1987, asserted after the election that the “survival of democracy” is now at stake in Costa Rica. “The first thing dictators want to do,” he said, “is to reform the constitution to stay in power.”

In her victory speech, President-elect Fernández promised that over the next four years, “change will be deep and irreversible.” She called the country’s second republic, which was established after a civil war in 1948, “a thing of the past” and vowed to “build the third republic” on its ruins. That disturbs many who grew up in the second republic, which abolished the army, developed the country, brought prosperity, promoted regional peace, and turned one-fourth of the nation’s territory into parks and nature preserves — all within the framework of a reasonably well-functioning democracy.

The rise of authoritarian populism in Costa Rica has followed a familiar pattern. People became fed up with the two mainstream political parties. Large-scale immigration — mostly from neighboring Nicaragua — inflamed social tensions. Drug gangs became frighteningly violent. Chaves, who had been living abroad as a World Bank official, returned home and in 2021 announced his presidential candidacy. He campaigned as an axe-wielding outsider, won a resounding victory, and has remained popular. The murder rate steadily increased during his four-year term, but he turned that to his advantage by blaming crime on overtolerant judges.

Some Costa Ricans yearn for the lock-’em-up policies of President Nayib Bukele of El Salvador, who imprisons suspected criminals indefinitely and without trial. Bukele visited Costa Rica before last month’s election and was the first foreign leader to call Fernández and congratulate her on her victory. During her campaign she promised to “implement tough measures that allow us to take criminals off the streets and put them where they belong: in jail.”

In our outdated picture, lawless repression like that practiced in El Salvador would be abhorrent in Costa Rica. Yet today the leaders of the two countries are embracing each other.

For several generations, Costa Rica had seemed to transcend its shared history with its northern neighbors. It and those four other countries won independence from Spain in 1821 as a single nation — the United Provinces of Central America. (Belize was not included because it was then a British colony, and Panama was part of Colombia.) Its most famous leader, Francisco Morazán, warned that splitting the five provinces into separate countries would “make us weak and miserable” and “deliver our peoples to anarchy and foreign domination.” He went unheeded. Torn by political divisions, the United Provinces split apart. Guatemala, Honduras, El Salvador, and Nicaragua have devolved into poverty and rule by corrupt elites.

Guatemala seemed to be poised for change after a reformist insurgent, Bernardo Arevalo, won the presidency in 2024. He has disappointed supporters by refusing to fight established power centers more forcefully and for succumbing to American influence. Most recently, he agreed to stop employing Cuban doctors for service in remote regions, a step urged by the United States.

Three months ago, voters in Honduras narrowly elected a right-wing president whom President Trump had endorsed. Next door in El Salvador, President Bukele has given himself power to rule indefinitely. He is riding a wave of popularity from Salvadorans who thank him for ending gang terror, regardless of the human cost. Most horrifying is Nicaragua, where aging husband-and-wife “copresidents” have ordered protesters shot down by the hundreds and forbidden all political activity.

For generations, Costa Ricans have looked at the other four former Central American provinces with disdain and an air of superiority. Now, spooked by drug-fueled violence and inspired by fiery promises, they may be moving toward the same authoritarianism that has shaped the history of their neighbors.

Stephen Kinzer is a senior fellow at the Watson School of International and Public Affairs at Brown University.