Luis Guillermo Solis speaks during a rally in San Jose on April 6, 2014. Picture: Juan Carlos Ulate

San Jose -

A candidate who was virtually unknown just months ago was elected Costa Rica's president on Sunday, becoming the first third-party member to win the highest office in decades.

Luis Guillermo Solis with the moderate Citizen Action Party (PAC) soundly defeated ruling party candidate Johnny Araya in a run-off vote that followed a first round of balloting on February 2 in this Central American country.

Araya dropped out of the race last month when surveys showed he had no chance of winning, but his name remained on the ballot.

Solis benefited greatly from voters' disgust with the scandal-tarred administration of outgoing President Laura Chinchilla. His goal was to earn at least one million votes to bolster his legitimacy - which he surpassed, earning 1.3 million or 78 percent of the ballots cast, election officials said.

A historian and former diplomat, Solis said that his administration will focus on transparency in the way public funds are used, economic growth to benefit all, and social tolerance.

“Costa Rica has decided to change,” the 55-year-old Solis told ecstatic supporters in his victory speech. “As president, I intend to carry out that change.”

Solis also urged Costa Ricans “at this moment of change” to “leave the conflicts behind”.

Araya, from Chinchilla's National Liberation Party (PLN), quickly conceded defeat, recognising the overwhelming vote outcome “with humility and respect”.

Political power in this small country of about five million has traditionally been traded between the social democratic PLN and the conservative Social Christian Unity Party (PUSC).

But scandals have tarnished both of the leading parties as well as the two-party system in Costa Rica, Latin America's oldest democracy.

Solis, who had an intense get-out-the-vote effort on social media, also effusively thanked his supporters via Twitter.

“The mandate that he received is indisputable,” said analyst Victor Ramirez. “He is the candidate with the highest amount of votes in the history of the country. The PLN got a beating.”

Jose Ramirez, a 26-year-old restaurant employee, said he hoped the election would bring “real change”, and that he voted for Solis “with the hope that he can end government robbery and govern for the people”.

Grocery vendor Sergio Mendez was clear about why he took time to vote, even though the result was a foregone conclusion.

“I voted for change, and against bi-party rule and corruption,” he told AFP.

Analyst Argentina Artavia warned that despite his popularity, Solis will not have a blank check when he takes office.

In Congress, the president-elect's party is currently second in strength behind the PLN. The remaining seats are divided among a leftist coalition and various conservative parties.

“This is the most fragmented Congress in history,” said analyst Vladimir de la Cruz.

Solis himself acknowledged the great responsibility - and tried to dampen the sky-high expectations for change.

“Not all of the problems can be resolved immediately. I don't have a magic wand,” he said ahead of the Sunday vote.

Solis is due to take office on May 8 for a four-year term. - Sapa-AFP