Socialist Lenin Moreno declared himself the "president of all Ecuadorans" Monday after a runoff election win that will extend a decade of leftist rule, but his conservative rival refused to accept the result.
Moreno, 64, a wheelchair user and champion of disability rights, is seen as a more moderate successor to outgoing President Rafael Correa.
Whereas Correa declared "21st-century socialism" in Ecuador and regularly berated the United States, Moreno is known for cracking jokes and reaching out to opponents.
Sunday's race between Moreno and conservative ex-banker Guillermo Lasso was closely watched as a barometer of the political climate in Latin America, where more than a decade of leftist dominance has been waning.
It was also a clutch day for WikiLeaks founder Julian Assange, who faced a threat by Lasso to expel him from his refuge in Ecuador's London embassy.
Political analysts said it was unlikely Lasso would succeed in overturning the result, given the grip that Correa's camp has on the levers of power.
But his challenge will only add to Moreno's headaches after an election that has left the country deeply divided.
With 99.42 percent of ballots counted from Sunday's vote, the National Electoral Council said Moreno won 51.17 percent against 48.83 percent for Lasso.
"I'm going to be the president of all Ecuadorans. Yes, all, but especially the poor," Moreno said in a speech to some 2,000 supporters outside the presidential palace.
- Protesters cry fraud -
Lasso vowed to challenge the result, alleging "blatant fraud."
"I cannot accept these results because they do not reflect the will of the people," he told a press conference.
He earlier met with election observers from the Organization of American States to present his case.
Some Lasso supporters protested outside election offices in Quito and other cities.
The electoral authority was under tight police guard.
Moreno's victory will likely hold, said Risa Grais-Targow of the Eurasia Group consultancy.
"The government enjoys a significant institutional advantage, with the National Electoral Council, the courts, and the legislature all firmly under its control," she said in a note.
If his victory is confirmed, Moreno will be the first wheelchair user to be elected Ecuador's president, and one of few such leaders in world history. His legs have been paralyzed since he was shot in a carjacking in 1998.
- Changing political map -
The leftist governments of Venezuela, Nicaragua, Cuba and Chile all sent their congratulations to Moreno.
It is a delicate time for the Latin American left, which is in decline.
Argentina, Brazil and Peru have all shifted to the right in recent months as the region has sunk into recession.
Lasso had vowed to undo Correa's legacy, after the country's economic boom went bust.
Boosted by high prices for its oil exports, Ecuador registered solid economic growth during the first eight years of Correa's presidency, before tipping into recession in 2015.
Correa won loyal fans among the poor with generous social benefits that helped slash the poverty rate in this country of 16 million people.
But he has also faced accusations of corruption and squandering the windfall of the oil boom.
"Moreno will face two challenges: starting his term in government with diminished popularity (for his side) and with an economy that is going through lean times," political scientist Esteban Nicholls from the Andean University of Ecuador told AFP.
- Assange wades in -
Lasso had vowed that within 30 days he would revoke the political asylum Ecuador granted to Assange in 2012 to help him avoid extradition to Sweden over a rape allegation.
The Australian denies the allegation and says he fears Sweden would send him to the United States to face trial for leaking hundreds of thousands of secret US military and diplomatic documents in 2010.
Assange commented on the election result in a provocative Twitter message, referring to accusations from Correa's camp that Lasso had money stashed in offshore accounts.
"I cordially invite Lasso to leave Ecuador within 30 days (with or without his tax haven millions)," he wrote.