Libertarian outsider Javier Milei has pulled off a massive upset with a resounding win in Argentina's presidential election, plunging the country into uncertainty in the midst of a crippling economic crisis.

The self-described "anarcho-capitalist" fired up Argentines fed-up with decades of economic stagnation under the long-dominant populist Peronist coalition.

While polls had predicted a tight race, provisional results showed Mr Milei had won with 55.7% of the vote to 44% scored by his rival, the Economy Minister Sergio Massa, who rapidly conceded defeat.

"Obviously the results are not what we had hoped for, and I have spoken to Javier Milei to congratulate him and wish him well, because he is the president that the majority of Argentines have elected for the next four years."

Thousands of Mr Milei's supporters waved flags and chanted "freedom" as they celebrated outside his campaign headquarters.

"We are tired of Peronism. Milei is an unknown, but better a madman than a thief," said 50-year-old writer Nacho Larranaga, wearing the blue-and-white Argentina flag as a cape.

Mr Milei, a 53-year-old economist with wild hair and thick sideburns, has drawn comparisons with former US president Donald Trump and Brazil's Jair Bolsonaro for his abrasive style and controversial remarks.

His main platform has been a plan to ditch the ailing peso for the US dollar and "dynamite" the Central Bank to do away with the "cancer of inflation".

"This is the change that us young people want. I am not afraid of Milei, I am afraid my dad won't be able to pay his rent. The Argentine peso isn't worth a thing," said 17-year-old Juan Ignacio Gómez.

Mr Milei is against abortion, is pro-gun, and has vowed to cut ties with Argentina's key trading partners China and Brazil. He has insulted Pope Francis, questioned the death toll under Argentina's brutal dictatorship, and says humans are not behind climate change.

He had toned down his rhetoric before the run-off to appeal to more moderate voters, but earlier in the campaign took to the stage wielding a powered-up chainsaw to symbolise the drastic cuts he plans to make to a bloated state.

Brazil's President Luiz Inacio Lula da Silva wished "good luck and success" to the Argentine government in a social media post that did not mention Mr Milei.

Read more: Milei's dilemma: How to solve a problem like Argentina?

Mr Milei's red-faced rants against the "thieving and corrupt political class" struck a nerve with Argentines struggling to make ends meet and fed up with politicians they see as the architects of their misery.

Others were spooked by his style in an election that has polarised the nation.

Teacher Catalina Miguel, 42, among a dejected crowd at Massa's campaign headquarters said she was in "shock".

"Milei will find us on the street defending every right he seeks to challenge. Half of Argentina does not support him."

On the other end of Mr Milei's chainsaw are millions of Argentines who depend on welfare assistance and generous government subsidies of fuel, electricity and transport - with bus tickets costing only a few cents.

Meanwhile, the country's coffers are in the red, with $44 billion (€40.3 billion) debt with the International Monetary Fund looming over the incoming government.

Political analyst Ana Iparraguirre said that Argentines should brace themselves.

"Whoever comes into office has to make some quick decisions that are going to hurt people."

'A lot of instability'

As Mr Milei is set to take office on 10 December, leaving his rival Mr Massa still in charge of the economy for three weeks, analysts predict a rocky ride with the strictly controlled peso ripe for devaluation.

"With almost 150% inflation, things could rapidly scale out of control in those weeks. So that's a period of a lot of instability," said Ms Iparraguirre.

Carlos Gervasoni, a political science professor at the Universidad Torcuato Di Tella in Buenos Aires, said that if he wins, Mr Milei will be "completely weak in Congress. He will definitely not be able to implement a lot of his ideas".

Mr Milei, a Buenos Aires politician who carried out much of his campaign on TikTok and other social media, surged to the front of the race in a primary election in August.

He then landed seven points behind Mr Massa in an October first-round vote.

After winning the backing of the third-placed centre-right opposition, he scrambled to appeal to moderate and hundreds of thousands of undecided voters.

"Argentina is part of the regional trend of a real weakening of political parties and the emergence of an outsider who... has a powerful message that resonates: just get rid of the political class and then everything will be ok," said Michael Shifter of the Inter-American Dialogue think-tank in Washington.