Costa Ricans head to the polls on Sunday to elect a new president, facing a choice between a candidate once investigated for corruption and another once demoted over sexual harassment allegations.

Both centrist former president Jose Maria Figueres and conservative ex-finance minister Rodrigo Chaves deny the allegations.

Campaigning has focused on how the hopefuls would address Costa Rica's central troubles: an external debt that is 70 percent of GDP, high levels of poverty -- at 23 percent -- and unemployment -- at 14 percent -- and corruption scandals in the public sector.

Chaves was a surprise qualifier for Sunday's run-off, having polled fourth ahead of February's first round.

He was the favorite in the most recent opinion polls, with almost 42 percent support, compared to 38 percent for Figueres, whose father Jose Figueres was also president.

But some 18 percent of people say they are undecided, which is what makes this election so hard to call.

Costa Rica's presidential candidates Jose Maria Figueres (centre) and Rodrigo Chaves (right) take part in a pre-election debate in San Jose on March 23, 2022
Costa Rica's presidential candidates Jose Maria Figueres (centre) and Rodrigo Chaves (right) take part in a pre-election debate in San Jose on March 23, 2022 AFP / Ezequiel BECERRA

"It's very difficult to pin down what either Figueres or Chaves want to do," said economist and analyst Daniel Suchar.

Suchar said the country frequently faces the same problem, with voters focusing on the candidates -- and their foibles -- rather than their policies.

Costa Rica has been described as the "happiest" country in Latin America, but its vital tourism industry was hard hit by the coronavirus pandemic.

Alongside Peru, it suffered the largest fall in employment figures in the region between 2019 and 2020, a drop of 14 percent.

Costa Rican presidential candidate Jose Maria Figueres (R) of the National Liberation Party is surrounded by the press after a debate in San Jose, on March 29, 2022
Costa Rican presidential candidate Jose Maria Figueres (R) of the National Liberation Party is surrounded by the press after a debate in San Jose, on March 29, 2022 AFP / Ezequiel BECERRA

"At a socioeconomic level the country has radically deteriorated, even before the pandemic with structural unemployment and the weak situation of public finances," said Alejandro Molina, an analyst from the National Policy Observatory at the University of Costa Rica.

Tourism is one of the major motors of the local economy and Costa Rica is a world leader in environmental protection, making it a key eco-tourism destination.

"The priority right now is lifting and reactivating the economy... and creating employment options for the great quantity of unemployed people," 35-year-old auditor Andres Fonseca told AFP in the capital San Jose.

Whoever wins the election will face the challenge of governing without a parliamentary majority, and will thus need to work with opposition parties to pass any policies.

Both men have reached this final stage of the election despite the specter of past scandals.

Chaves, who spent six months as finance minister in the outgoing government, was investigated over sexual harassment complaints brought by multiple women while he was a senior official at the World Bank.

He was demoted, though not fired, and has dismissed his behavior as "jokes" that were "misinterpreted due to cultural differences."

Costa Rican presidential candidate for the Social Democratic Progress party Rodrigo Chaves, speaks at his campaign headquarters after the polls closed in San Jose, Costa Rica, February 6, 2022
Costa Rican presidential candidate for the Social Democratic Progress party Rodrigo Chaves, speaks at his campaign headquarters after the polls closed in San Jose, Costa Rica, February 6, 2022 AFP / Randall CAMPOS

For some of his supporters, Chaves's history has nothing to do with Costa Rica's election.

"I hope he will bring salvation... Those that criticize him are not in the economic situation that most of the population is in," said Rolando Gutierrez, a supporter.

Analyst Gina Sibaja said Chaves' continued appeal shows sexism is deep-rooted in the country.

"Those who lose the most are us women... He was victimized by his punishment and that has generated empathy, although mostly amongst men given that harassment in Costa Rica is an everyday occurrence."

Chaves, an economist who worked for 30 years at the World Bank, has been campaigning on corruption reform, vowing to "clean the house."

Figueres, president from 1994-99, was investigated for allegedly taking some $900,000 from French engineering firm Alcatel, which has admitted to bribing officials.

The ex-president, who worked abroad at the time as executive director of the World Economic Forum (WEF), refused to give evidence in the case in 2004 and returned to Costa Rica only in 2011 when the investigation expired.

His father was the one who abolished Costa Rica's army as president in 1948.

Figueres has focused on his experience on the campaign trail, and criticized his opponent's lack of it.

"I will vote for Figueres because Costa Rica needs a change," said one of his supporters, Karla Zuniga.

"The economy has been destroyed and there is no clear decision making."

Figueres represents the centrist National Liberation Party (PLN), which won nine out of 15 elections between 1953 and 2010.

Chaves leads the newly formed right-wing Social Democratic Progress Party.

But at least one portion of the electorate is unimpressed with the choice on offer.

"Neither of them represents us," said Rocio Jimenez, a member of the Women to the Fore collective.

"They represent the whole patriarchal structure and neither of them will defend women's rights."

Some 3.5 million of Costa Rica's five million people are eligible to vote.