Millionaire businessman Guillermo Lasso will be Ecuador’s next president after pulling off a remarkable victory in Sunday’s election, overcoming a deficit of 13 percentage points between the first and second rounds to beat leftwing candidate Andrés Arauz.

With 98.5 per cent of the vote counted, the National Electoral Council gave Lasso 52.5 per cent of the vote to Arauz’s 47.5 per cent. Almost every opinion poll in the run-up to the vote had suggested Arauz would win, albeit by a narrow margin.

In upmarket areas of Quito, Ecuador’s capital, motorists honked and shouted “Lasso! Lasso!” as they drove through the streets.

“Today is a day of celebration. Democracy has triumphed,” Lasso, 65, told supporters in the port city of Guayaquil. “Ecuadoreans, all of you . . . have chosen a new path — a very different path from the one Ecuador has followed for the past 14 years.”

Financial markets reacted favourably, with Ecuador’s US dollar-denominated bonds soaring. The recently restructured bond set to mature in 2035 rose 13 cents to 62 cents on the dollar, while the 2030 bond rose by a similar magnitude to 75 cents on the dollar.

The rally in Ecuadorean government debt had kicked off a few weeks ago as opinion polls suggested Lasso was closing the gap on Arauz, a 36-year-old leftwing economist who had the backing of Rafael Correa, the country’s former leader and had hoped to become Ecuador’s youngest president.

Lasso has promised a clean break with the legacy of Correa, who poured money into social programmes during his decade in power from 2007 but left the country polarised and indebted to China.

The president-elect’s agenda is ambitious. He has pledged to balance the budget in four years, a monumental task given the country’s precarious finances and the impact of the coronavirus pandemic. The economy shrank 7.8 per cent last year and the central bank expects it to grow just 3.1 per cent in 2021.

Lasso has vowed to create 2m jobs in the country of 17.4m and said Ecuador should double its oil production in the medium term. He has also said the country will continue to use the US dollar as its official currency.

The president-elect has said he will largely abide by the $6.5bn lending programme Ecuador agreed with the IMF last year, although he has insisted he will not implement some of the suggested tax rises. His government, which will take office in May, is expected to talk to the IMF about making minor adjustments.

Lasso has also said he will respect the deal Ecuador reached with bondholders last year to restructure $17.4bn of sovereign debt.

His victory came on his third attempt at the presidency. In 2013, he was soundly beaten by Correa and in 2017 he lost narrowly to Lenín Moreno, who did not stand for re-election.

Lasso barely scraped into the run-off with less than 20 per cent of the vote in the first round in February, when Arauz took a third of the vote.

“No candidate has ever overcome a double-digit disadvantage in the first round to secure a run-off victory,” said Norman McKay, Latin America analyst at The Economist Intelligence Unit.

Johanna Andrango, an Ecuadorean political analyst, credited Lasso’s comeback with an image makeover in the second round of campaigning.

“He completely changed strategy. Instead of attacking Correa and Arauz, he tried to get across a message of inclusion and he reached out to sectors of society who wouldn’t normally vote for him, like the LGBT community,” she said. “He started using TikTok. Some 40 per cent of the electorate in Ecuador are millennials and centennials and he had to reach them.”

Perhaps the greatest symbol of Lasso’s metamorphosis was his red shoes. Shortly after the first round, he published a post on TikTok, the popular short video app, wearing a trendy pair of red trainers, pink three-quarter-length trousers and a white jacket. Some ridiculed him, saying the conservative banker and member of the Catholic institution Opus Dei was making an absurd attempt to capture the young vote. But it might have worked.

“I voted for Lasso,” said Monica Villanon as she left a polling station in Quito wearing red shoes. “He isn’t an economist, doesn’t have a PhD but he has experience and a good heart. I can’t say he’s totally convinced me but there’s no other credible option.”

Anthony Andino, a 19-year-old voter participating in his first election, said Correa — and by extension Arauz — represented the past. “I think Lasso promises more because Arauz comes with Correa in tow,” he said.

Many voters said they were won over by Lasso’s life story. The youngest of 11 children, he worked part-time at the Guayaquil stock exchange aged 15 to pay for his school fees. He later became the largest shareholder at Banco Guayaquil and transformed it into one of the country’s most successful lenders.

In 2013, he suffered a walking accident and needed a serious operation on his back. He turned up to vote in Guayaquil on Sunday walking with the aid of a crutch — and wearing red shoes.