Right-wing political scientist Laura Fernandez on Sunday won Costa Rica’s presidential election by a landslide, after promising to crack down on rising violence linked to the cocaine trade.

Fernandez’s nearest rival, economist Alvaro Ramos, conceded defeat as results showed the ruling party far exceeding the threshold of 40 percent needed to avoid a runoff.

With 94 percent of polling stations counted, the political heir of outgoing Costa Rican President Rodrigo Chaves had captured 48.3 percent of the vote compared with Ramos’ 33.4 percent, the Supreme Electoral Tribunal said.

Photo: AFP

As soon as the first results were announced, members of Fernandez’s Sovereign People’s Party erupted in celebrations around the country, waving blue, red and white-striped Costa Rican flags.

“Viva Rodrigo Chaves,” some cheered, in a nod to Fernandez’s mentor.

Appearing via videoconference at her party’s official election night gathering in the capital, San Jose, Fernandez, 39, thanked Chaves for giving her “the confidence to be president-elect of Costa Rica” and said his legacy was in good hands.

She vowed to “fight tirelessly” to ensure Costa Rica “continues on the path of economic growth, freedom and above all, the progress of our people.”

The nation of 5.2 million people, famous for its white-sand beaches, has long been seen as an oasis of stability and democracy in Central America, but in the past few years it has gone from a transit point to a logistics hub in the global drug trade.

Drug trafficking by Mexican and Colombian cartels have seeped into local communities, fueling turf wars that have caused the murder rate to jump 50 percent in the past six years, to 17 per 100,000 inhabitants.

Fernandez cites iron-fisted Salvadoran President Nayib Bukele, who has locked up thousands of suspected gang members without charge, as an inspiration on how to tamp down crime.

Bukele was the first foreign leader to congratulate her.

Fernandez’s win confirms a rightward lurch in Latin America, where conservatives have ridden anger toward corruption and crime to win power in Chile, Bolivia, Argentina and Honduras.

Chaves plucked Fernandez from relative anonymity to serve as planning minister and chief of staff.

In a conversation with her on Sunday night, Chaves said he was confident that under her leadership “there will be neither dictatorship, nor communism.”