BUENOS AIRES — Right-wing populist Javier Milei will become the next president of Argentina after promising a dramatic shake-up to the state in a fiercely polarized election campaign held amid deep discontent over soaring inflation and rising poverty.

Economy Minister Sergio Massa of the Peronist party conceded defeat and congratulated Milei, a self-described anarcho-capitalist who has drawn frequent comparisons to former U.S. President Trump.

Immediately after Massa’s concession speech, the Argentine electoral authority released partial results: With 86.6% of votes tallied, Milei had 55.95% and Massa 44.04%.

With a Milei victory, the country will swing to the right amid discontent over soaring inflation and rising poverty and empower a freshman lawmaker who got his start as a television talking head blasting what he called the “political caste.”

Inflation has soared to more than 140% and poverty has worsened while Massa has held his post. Milei proposes to slash the size of the state and rein in inflation, and the government minister he ran against has warned people about the negative impacts of such policies.

The election forced many to decide which of the two they considered to be the least bad choice.

“Whatever happens in this election will be incredible,” said Lucas Romero, director of the local political consultancy Synopsis. “It would be incredible for Massa to win in this economic context or for Milei to win facing a candidate as professional as Massa.”

Milei went from blasting the country’s “political caste” on TV to winning a lawmaker seat two years ago. The economist’s screeds resonated widely with Argentines angered by their struggle to make ends meet, particularly young men.

“Money covers less and less each day. I’m a qualified individual, and my salary isn’t enough for anything,” Esteban Medina, a 26-year-old physical therapist from Ezeiza, on the outskirts of Buenos Aires, told the Associated Press on the sidelines of a Milei rally last week.

Massa, as one of the most prominent figures in a deeply unpopular administration, was once seen as having little chance of victory. But he managed to mobilize the networks of his Peronist party and clinched a decisive first-place finish in the first round of voting.

His campaign cautioned Argentines that his libertarian opponent’s plan to eliminate key ministries and otherwise sharply curtail the state would threaten public services, including health and education, and welfare programs many rely on.

Massa also drew attention to his opponent’s often aggressive rhetoric and has openly questioned his mental acuity; ahead of the first round, Milei sometimes carried a revving chainsaw at rallies.

Speaking after casting her vote at the stately University of Buenos Aires Law School, Jenifer Pio, 36, told the AP that she feared a Milei victory would risk the return of dictatorship.

“Milei doesn’t have the faintest idea of how to govern,” said Pio, a homemaker. “It isn’t bad that he’s prideful, but he would need to have a bit more stability. He’s unstable emotionally and psychologically. He’s unwell.”

Ana Iparraguirre, a partner at pollster GBAO Strategies, said Massa’s “only chance to win this election when people want change ... is to make this election a referendum on whether Milei is fit to be president or not.”

“We’re starting a new chapter in Argentina, and this chapter requires not only goodwill, intelligence and capability but, above all, dialogue and the necessary consensus for our homeland to traverse a much more virtuous path in the future,” Massa told journalists Sunday after casting his ballot.

Milei accused Massa and his allies of running a “campaign of fear,” and he walked back some of his most controversial proposals, such as loosening gun control. In his final campaign ad, Milei looks at the camera and assures voters that he has no plans to privatize education or healthcare.

“We did a great job despite the fear campaign and all the dirty tactics they used against us,” Milei told journalists after he voted amid a large security operation.

Nearby, Mariano Ariel Franco, 44, cast his ballot in favor of Milei, saying that Argentina “needs a complete change. I think that you’re not getting anywhere continuing like now, and it’s only getting worse.”

Franco, an assistant cook at a high-end restaurant, said he’s homeless because he’s not able to make ends meet on his salary.

Most preelection polls, which were notoriously wrong at every step of this year’s campaign, showed a statistical tie between the two candidates.

Underscoring the bitter division this campaign brought to the fore, Milei received both jeers and cheers on Friday night at the legendary Colón Theater in Buenos Aires.

Those divisions were also evident Sunday when Milei’s running mate, Victoria Villaruel, went to vote and was met by protesters angry at her claims that the number of victims from Argentina’s bloody 1976-1983 military dictatorship is far below what human rights organizations have long claimed, among other controversial positions.

The vote took place amid Milei’s allegations of possible electoral fraud, reminiscent of those from Trump and former Brazilian President Jair Bolsonaro. Without providing evidence, Milei claimed that the first round of the presidential election was beset by irregularities that affected the result.

Experts say that such irregularities cannot swing an election and that Milei’s assertions are partly aimed at firing up his base and motivating his supporters to become monitors of voting stations.

Such claims spread widely on social media and, at Milei’s rally in Ezeiza last week, all those interviewed told the AP they were concerned about the integrity of the vote.

Politi and Biller write for the Associated Press.