Argentines on Sunday chose Javier Milei, a far-right libertarian who has drawn comparisons to Donald J. Trump, as their next president, a lurch to the right for a nation struggling under an economic crisis and a sign of the enduring strength of the global far right.

Mr. Milei, 53, an economist and former television personality with little political experience, burst onto the traditionally closed Argentine political scene with a brash style, an embrace of conspiracy theories and a series of extreme proposals that he says are needed to upend a broken economy and government.

Mr. Milei drew 56 percent of the vote, with 95 percent of the ballots counted, defeating Sergio Massa, Argentina’s center-left economy minister, who had 44 percent. Mr. Massa, 51, conceded defeat even before official results were released.

Mr. Milei has pledged to slash spending and taxes, close Argentina’s central bank and replace the nation’s currency with the U.S. dollar. He has also proposed banning abortion, loosening regulations on guns and considering only countries that want to “fight against socialism” as Argentina’s allies, often naming the United States and Israel as examples.

In his victory speech, he attacked the political “caste” that he says has enriched themselves at the expense of average Argentines, saying “today is the end to Argentine decadence.” But he also offered an olive branch.

“I want to tell all Argentines and all political leaders and all those who want to join the new Argentina: You’re going to be welcome,” he said.

Mr. Milei’s election is a victory for the global far-right movement that gained strength with the election of Mr. Trump and similar politicians, among them Jair Bolsonaro of Brazil, though it has faltered in recent years with electoral losses. Mr. Bolsonaro and Spain’s far-right Vox party have cheered on Mr. Milei; the former Fox News host Tucker Carlson traveled to Argentina to interview him; and the billionaire Elon Musk on Sunday said after Mr. Milei’s victory that “prosperity is ahead for Argentina.”

Mr. Trump congratulated Mr. Milei. “I am very proud of you,” he said in an online post. “You will turn your country around and truly Make Argentina Great Again!”

Still, some political analysts say that Mr. Milei’s ascent reflects many Argentines’ desperation for change rather than support for his ideology.

Some voters share his extreme views, “but there are others who voted for him because they see in Milei a way to express their frustration in the face of an economic and political reality that has been ugly to them for a long time,” said Carlos Pagni, a professor of history and a political columnist at La Nación, one of Argentina’s largest newspapers.

“They don’t look at Milei’s ideology,” he said. “They see that Milei is angry and that Milei is proposing a break.”

Mr. Milei has embraced the comparisons to Mr. Trump and Mr. Bolsonaro. He has clear differences with the two other politicians, including his strong adherence to a libertarian ideology that has led him to support, in theory, policies like open immigration and drug decriminalization. But Mr. Milei’s political style resembles theirs in many ways. He harshly attacks his critics and the news media, he calls the scientific consensus on climate change a socialist plot, he argues that a shadowy cabal controls the country and he even has an unruly hairdo that has become an online meme.

For many observers, the most worrisome parallel was Mr. Milei’s pre-emptive claims of voter fraud. He has openly questioned the results of the 2020 U.S. election and 2022 Brazilian election, and for months has claimed with scant evidence that the Argentine election was rigged against him. He had warned that if he lost on Sunday, it may have been because the vote was stolen. After signs emerged on Sunday that he would win, Mr. Milei’s campaign told reporters that the election was clean.

Mr. Milei has also downplayed the atrocities of Argentina’s bloody military dictatorship from 1976 to 1983, calling them “excesses” as part of a “war” against leftists. He said during a national debate that the number of people killed under the dictatorship was far smaller than the widely accepted estimates of as many as 30,000 people.

That rhetoric, paired with his warnings of a rigged election, raised broad concerns in Argentina about his potential effect on the nation’s democracy. Ahead of the vote, more than 20 prominent Argentines recorded and released a video promoting democratic values.

Mr. Milei will now confront a major challenge that virtually no other Argentine president has been able to solve for decades: the Argentine economy.

Failed economic policies have long left Argentina with one of the world’s most perpetually unstable economies, yet even by its standards, the nation of 46 million is in one of its worst crises.

Annual inflation has soared past 140 percent — the third highest rate in the world — more than two in five Argentines now live in poverty and the value of Argentina’s currency has plummeted. In April 2020, at the start of the pandemic, $1 bought 80 pesos, using an unofficial rate based on the market’s assessment of the currency. This week, $1 bought nearly 1,000 pesos.

Mr. Milei has argued that the solution is a drastic break with old policies. His campaign was centered on pledges to “blow up” the central bank and dollarize the economy, illustrated by him smashing miniature versions of the bank and hoisting giant $100 bills with his face on it.

His other campaign prop was a chain saw that he would wave around at rallies. The saw represented the deep cuts he wants to deliver to government, including lowering taxes; slashing regulations; privatizing state industries; reducing the number of federal ministries to eight from 18; shifting public education to a voucher-based system and public health care to insurance-based; and cutting federal spending by up to 15 percent of Argentina’s gross domestic product. He has recently softened some proposals after blowback.

Economists and political analysts have said Mr. Milei lacks the political support and the economic conditions to pull off such radical change. His nascent Liberty Advances party holds just seven of the 72 seats in Argentina’s Senate and 38 of the 257 in its House. Mr. Milei was elected to Argentina’s lower house of Congress in 2021, and his seat will now go to another member of his party.

Still, for many Argentines, Mr. Milei will be a welcome break from Peronism, the political movement that has held the presidency for 16 of the past 20 years, mostly installing leftist policies over that period that have jerked the country from boom to bust.

“I want a future,” said Dana Durante, 22, a personal trainer at a jubilant street celebration in downtown Buenos Aires, where people chanted “freedom” and waved Argentine flags. She said she had been considering leaving the country if Milei had lost.

“This is a revolution,” she said. “For a different country. For a better Argentina.”

Many voters, after the most recent economic decline and a string of corruption scandals, were desperate for any change, despite whatever misgivings they had about Mr. Milei’s eccentric personality and pugnacious temperament.

“I can’t keep voting for corruption,” said Silvana Cavalleri, 58, a real estate agent, after reluctantly voting for Mr. Milei. “I hope that Milei is at least less corrupt. Not that I’m thinking he isn’t at all.”

Mr. Milei overcame criticism and questions about a variety of unusual behaviors during the campaign, including his harsh attacks against the pope, his clashes with Taylor Swift fans, his claims of being a tantric-sex guru, his dressing up as a libertarian superhero and his close relationship with his Mastiff dogs that are named for conservative economists — and are also all clones.

Some voters were turned off by his past outbursts and extreme comments over years of work as a television pundit and personality. In one clip from years earlier that was shared widely during the campaign, Mr. Milei argues that the government is corrupt and robs from average Argentines.

“The state is a pedophile in a kindergarten,” he said, “with the children chained up and bathed in Vaseline.”

Mr. Milei’s running mate, Victoria Villarruel, has also been criticized for her history of comments, including some defending the dictatorship. Ms. Villarruel, who comes from an Argentine military family, runs an organization that recognizes victims of attacks carried out by leftist guerrillas before the military took power.

She and Mr. Milei have argued that 8,000 people disappeared during the dictatorship, despite records showing that even the Argentine military believed 22,000 people had disappeared just two years into it.

After voting in a school on Sunday, Ms. Villarruel criticized a nearby mural dedicated to the 30,000 people believed to have been killed during the dictatorship. “Doing graffiti for the 30,000 is like going to a cemetery and painting Barney Bear,” she said, referring to a cartoon character.

Mr. Milei will be sworn in as president on Dec. 10, the 40th anniversary of the inauguration of the first democratically elected president following the fall of the military dictatorship.

Natalie Alcoba and Lucía Cholakian Herrera contributed reporting.