Long a byword for laidback environmental tourism, Costa Rica is now wrestling with a surge in violence so striking that its government is borrowing a page from nearby El Salvador, which took draconian steps to tackle its own crime problems.
In an effort to cut a homicide rate that has soared 40% in the last year alone, Costa Rican President Rodrigo Chaves has introduced tough new legislation to combat crime, dubbing El Salvador a "reference" point.
"Chaves is planning a crackdown... He's a security hardliner pushing for a course correction," said Chris Dalby, director of the World of Crime think tank. "'Mano dura' (firm hand) talk plays well."
Chaves' ideas include increasing jail sentences for minors to the adult maximum of 50 years, allowing extraditions, and extending use of preventive detention, making it easier to hold suspects with limited evidence.
"Extraordinary times require extraordinary measures," Chaves said as he presented his National Security Plan in November.
Costa Rica is one of a growing number of Latin American countries seeking to tackle the expansion of drug cartel activity by emulating Salvadoran President Nayib Bukele's sweeping crackdown.
Bukele's suspension of constitutional rights, which among other things allows police to indefinitely detain suspected gang members without the right to a lawyer, has elicited strong condemnation by human rights campaigners.
But it has had a significant impact on crime and is domestically popular, putting Bukele on the verge of a historic re-election next month. And it has become a beacon for regional politicians battling gangs, from Chile to Ecuador.
While Chaves insists he doesn't want to become exactly like Bukele, his plan is still a radical shift for Costa Rica, which has traditionally taken a gentler approach to crime prevention.
Many in the opposition-controlled Congress publicly still cleave to that approach, but even there, whispers of support for tougher policies are growing, fueled by fears for the country's $2 billion tourism sector.
"(Bukele's) work dismantling organised crime has been excellent and worth analysing to replicate in Costa Rica," David Segura, a lawmaker in the opposition conservative New Republic party said in a recent social media post.
Costa Rica saw its murder rate jump to 17.2 per 100,000 people in 2023 from 11.7 in 2018. By contrast in El Salvador, the rate plunged to 2.4 after being the highest in the world less than a decade earlier.
Bukele was voted Costa Ricans' favourite political leader in an October survey by research firm Indice. Meanwhile, Chaves' own poll ratings have plummeted nearly 30 percentage points since his election in May 2022.
Analysts say Costa Rica's spike in homicides has been driven by gang warfare among cocaine traffickers. Gang recruitment was helped by growing social discontent and unemployment during the COVID-19 pandemic.
Political friction with neighbouring Nicaragua and Honduras has also hindered regional security cooperation, which analysts say has fed a sharp drop in cocaine seizures in Costa Rica.
Costa Rica's traditionally light-touch handling of suspects - who are often simply given precautions in lieu of arrest - has also fueled the problem, according to Jorge Torres, Chaves' security chief.
"How can a strong 17-year-old boy who killed a citizen with an AK-47 be treated like an 8-year-old boy who stole some candy?," Chaves said in October, arguing criminal groups recruit minors precisely because they often get off scot-free.
For now, Chaves' "mano dura" bill is stuck in Congress, with opposition critics calling it anti-Costa Rican and authoritarian.
"We live in a democracy. We're not El Salvador or any of those countries that violate individual rights," said Gloria Navas, a New Republic lawmaker who heads the congressional committee on Security and Drug Trafficking.
Chaves needs the backing of at least 29 of 57 lawmakers for most of the proposals, and his party currently has only nine seats. But he has been able to previously pass legislation with support from other conservative factions.
Chaves' other challenge is that Costa Rica is less used to pursuing narcos than its neighbours, having abolished its army over 70 years ago to prioritise progressive welfare policies.
Proponents of the welfare-first approach say historically that helped to shield Costa Rica from violence long prevalent in much of Central America, and that more welfare spending could do so again.
Laura Chinchilla, president from 2010 to 2014, said she had successfully curbed violence by preventing the poor from falling into crime.
"I don't think we have to resort to the militarised models of other countries," she told Reuters. "If we've done it (the peaceful way) for a lifetime, we should be able to do it now."
Others in Congress think Chaves' plan doesn't go far enough.
Opposition conservative lawmaker Lesley Bojorges recently backed the idea of harsh El Salvador-style prisons, while judicial chief Randall Zuñiga has expounded the merits of more detentions.
Sergio Araya, a political scientist at the Konrad Adenauer Foundation, a conservative think tank, said such tougher approaches were on track to become more popular with Costa Ricans weary of crime in the coming months and years.
"There's likely to be growing support for ideas in the so-called 'Bukele model,'" he said.