Right-wing opposition candidate Guillermo Lasso alleged fraud Sunday in Ecuador's presidential runoff election, vowing to contest results that had his rival Lenin Moreno extending a decade of socialist rule.
Moreno, the designated heir to President Rafael Correa's "21st-century socialism," had 51.12 percent of the vote to 48.88 percent for ex-banker Lasso, with 96.21 percent of districts reporting, said the National Electoral Council.
Lasso said his campaign had evidence of an attempt to rig the results.
"We are going to defend the will of the Ecuadoran people in the face of an attempted fraud that aims to install what would be an illegitimate government," he said, setting up what could be a long and ugly fight.
The election is being closely watched as a barometer of the political climate in Latin America, where more than a decade of leftist dominance has been waning.
It may also decide the fate of WikiLeaks founder Julian Assange, who has been holed up in Ecuador's London embassy since 2012.
Both candidates claimed victory on the basis of conflicting exit polls.
"We will continue this process that has changed Ecuadorans' lives, especially for the poorest citizens," Moreno, a wheelchair user paralyzed in a 1998 carjacking, triumphantly told supporters.
He then launched into an exuberant victory party at which he regaled the crowd with his singing, belting out Latin classics alongside Correa.
Lasso fired back in a speech to his own supporters.
"Starting today, Ecuador has a president who is going to promote national unity," he said.
Correa presided over an economic boom that has recently gone bust.
In Latin America, where a so-called "pink tide" of leftist leaders has been ebbing, the vote is seen as crucial.
Argentina, Brazil and Peru have all shifted to the right in recent months, as the region has sunk into recession and leftist leaders have been tarnished by a string of corruption scandals.
Boosted by high prices for its oil exports, Ecuador registered solid economic growth averaging 4.4 percent per year during the first eight years of Correa's presidency, before tipping into recession in mid-2015.
Correa won loyal fans among the poor with generous social benefits that helped reduce the poverty rate from 36.7 percent to 23.3 percent in this country of 16 million people.
But he has also faced accusations of corruption and squandering the windfall of the oil boom.
Moreno, 64, won the first-round vote on February 19 with 39 percent to Lasso's 28 percent.
But Lasso, 61, united much of the opposition vote behind his promises to create a million jobs, eliminate 14 different taxes and boost foreign investment in Ecuador.
Correa was triumphant at Moreno's victory party, where supporters chanted, "Correa, we'll miss you."
"I'm leaving the country in good hands," he said.
In another of the race's hot issues, Lasso threatened to revoke the political asylum Ecuador has granted its most famous guest, Assange.
Correa, an outspoken critic of the United States, let the WikiLeaks founder stay at the London embassy to avoid arrest and extradition to Sweden over a rape allegation.
Assange waded into the electoral fray Sunday, congratulating Moreno and tweeting: "I cordially invite Lasso to leave Ecuador within 30 days (with or without his tax haven millions)."
That was a reference to accusations from Correa's camp that Lasso has money stashed in offshore accounts.
Assange, who denies the rape accusation against him, says he fears Sweden wants to send him to the United States to face trial for leaking hundreds of thousands of secret US military and diplomatic documents in 2010.
The 45-year-old Australian's case has returned to the spotlight since WikiLeaks was accused of meddling in the US election last year by releasing a damaging trove of hacked emails from presidential candidate Hillary Clinton's campaign and her Democratic party.