He made his name disparaging people on television. He levels harsh attacks against critics online. He sports an unruly hairdo that has become a meme. And he is now the leader of his country’s far right.

Donald J. Trump, and his rise to the American presidency in 2016, shares some striking similarities with the man behind the moment unfolding in Argentina, the nation’s new political sensation, Javier Milei.

Mr. Milei, a libertarian economist and television pundit, was once seen as a sideshow in Argentina’s presidential race, not taken seriously by the news media or his opponents. Now — after a brash, outsider campaign based on a promise that he alone can fix the nation’s deep economic woes — he is the favorite to win the election outright on Sunday or head to a runoff next month.

Mr. Milei, 52, has already upended the politics of this nation of 46 million. His pledges to eliminate Argentina’s central bank and ditch its currency for the U.S. dollar have dominated the national conversation, while also helping to fuel a further collapse in the value of the Argentine peso.

But it has been his bellicose political style that has attracted comparisons with Mr. Trump, as well as widespread concern in Argentina and beyond about the damage his government could inflict on Latin America’s third-largest economy.

Mr. Milei has attacked the press and the pope; declared climate change part of “the socialist agenda”; called China, Argentina’s second-largest trade partner, an “assassin”; pledged looser controls on guns; claimed he is the victim of voter fraud; questioned the most recent presidential elections in the United States and Brazil; and suggested that the far-right riots that followed those votes were leftist plots.

“He is quite clearly a mini-Trump,” said Federico Finchelstein, an Argentine who chairs the history department at the New School in New York and studies the far right around the world.

Mr. Milei, Mr. Trump and Jair Bolsonaro, Brazil’s former president, are all leading practitioners of the modern strain of far-right politics, Mr. Finchelstein said, marked by vulgarity, attacks on institutions, discrediting of the news media, distrust of science, a cult of personality and narcissism.

“Trump is an icon of this new form of extreme populism,” Mr. Finchelstein said. “And Milei wants to emulate him.”

Mr. Milei has embraced comparisons to Mr. Trump, whom he has called “one of the best presidents in the history of the United States.” He has worn “Make Argentina Great Again” hats and, much like Mr. Trump, waged his campaign largely on social media. And in the two months before Sunday’s vote, he granted an interview to one American broadcast personality: the former Fox News host Tucker Carlson.

Mr. Milei’s campaign declined repeated requests for an interview with The New York Times.

With two master’s degrees in economics, Mr. Milei can sound professorial at times, opining on monetary policy and a strain of libertarianism he follows called anarcho-capitalism.

He has called the state “a criminal organization” that collects taxes “at gunpoint.” And he says he is driven by a mission to shrink government and remove it from people’s lives, starting with Argentina’s central bank.

His libertarian ideals have also made him less conservative on some social issues. He has said that as long as the state doesn’t have to pay for it, he could support drug legalization, open immigration, sex work, transgender rights, same-sex marriage and selling organs.

Abortion, however, he calls “murder” and promises to put it to a referendum in Argentina, where it has been legal since 2020.

Mr. Milei surprised pollsters in August when he won Argentina’s open primaries with about 30 percent of the vote. He has since led his two main challengers in the polls: Sergio Massa, Argentina’s center-left economy minister; and Patricia Bullrich, a right-wing former security minister.

Mr. Milei has received nearly blanket news coverage during the campaign, both for his radical economic proposals and his eccentric personality. He is a self-proclaimed tantric-sex teacher with five cloned mastiff dogs. His girlfriend is a professional impersonator of one of his political archrivals. And his campaign manager and chief political adviser is his sister.

Mr. Milei’s signature look — a leather jacket, an untamable mop of hair and long sideburns — is designed to conjure the comic-book character Wolverine, according to Lilia Lemoine, a professional cosplay performer who is Mr. Milei’s stylist and is running for Congress on his ticket. Because, like Wolverine, she said, “he is an antihero.”

The result is a cultlike following. At a recent event in Salta, a city in Argentina’s mountainous northwest, Mr. Milei rode in a truck bed as thousands of voters pushed in for a closer look. Supporters wore messy wigs, passed out fake $100 bills with his face and displayed art of his dogs, four of which are named for conservative economists.

“Yes, everyone describes him as crazy, for everything, but who better than a crazy person to move the country forward?” said María Luisa Mamani, 57, a butcher-shop owner. “Because the sane ones didn’t do anything.”

Mr. Milei appeared briefly but did not speak. Instead, the event was largely a stage for social-media content created by unpaid college-age influencers who travel with Mr. Milei and film him.

They have helped him build an enormous online presence and intense youth following. (The legal voting age in Argentina is 16.)

Luján López Villa, 20, a high school senior in the small town of Chicoana, said Mr. Milei had near-unanimous support among her classmates, largely because he was the “cool” candidate, despite warnings from teachers that his plans to dollarize the economy are dangerous.

“They want to change our minds,” she said. “We’re going to keep following him.”

It is no surprise that Argentines are eager for change. Decades of economic mismanagement, much of it in the hands of Mr. Massa’s incumbent Peronist party, have plunged Argentina into a big financial hole.

In April 2020, at the start of the pandemic, $1 bought about 80 pesos; one day last week, $1 bought more than 1,000 pesos. Those figures are under an unofficial exchange rate that best reflects the market’s view of the peso, part of a byzantine system of currency controls the government uses to try to keep U.S. dollars in the country.

Mr. Milei wants to discard those rules as president, partly by switching to dollars.

Both Mr. Milei and economists have said that dollarizing the economy will most likely require tens of billions of dollars, but it is not clear where Argentina could get such an investment. The country is struggling to pay a $44 billion debt to the International Monetary Fund.

Mr. Milei would also not have much congressional support for dollarization, though he has said that he would put the issue to a national referendum.

Emmanuel Alvarez Agis, Argentina’s former deputy economy minister under a leftist administration, said that if Mr. Milei could dollarize, it would mostly solve inflation — but produce a host of other problems, including a decrease in real wages, higher unemployment and less flexibility to soften the effects of economic downturns.

Mr. Milei has also promised a pro-market, small-government overhaul, including pledges to: lower taxes; slash regulations; privatize state industries; shift public education to a voucher-based system and public health care to insurance based; reduce the number of federal ministries to eight from 18; and cut federal spending by 15 percent of Argentina’s gross domestic product.

Such deep spending cuts would require significant reductions to pensions, education and public safety, Mr. Alvarez Agis said. “I don’t think that they are discussing numbers in a serious way,” he said.

After months of campaigning by the candidates, Sunday will test whether voters are ready to take a chance on Mr. Milei. He could win the election outright with 45 percent of the vote, or 40 percent with a margin of at least 10 percentage points. If no candidate reaches any of those thresholds, the race will go to a runoff on Nov. 19 between the top two finishers.

Even though Mr. Milei won the primary, he still claimed fraud, saying rivals stole his parties’ ballots from polling stations, preventing citizens from voting for him. Mr. Milei also said his party’s ballots were found in the trash at a school. His party did not provide any evidence.

Mr. Milei said his party had complained to election officials, but election officials disputed that.

“There was no complaint or challenge, nor was there any systematic ballot theft,” Argentina’s electoral court said in a statement. “We are concerned that such statements are made without accompanying legal filings to investigate.”

Mr. Milei’s campaign said it had recruited 100,000 volunteers to monitor polling stations on Election Day. But in a television interview on Thursday, Mr. Milei said he was still worried about stolen votes.

He claimed that the alleged fraud in the primaries had cost him at least several percentage points of support. “Some say two and a half points, others say three, and others say five,” he said. “Whatever the number is, it may be decisive.”

Natalie Alcoba and Lucía Cholakian Herrera contributed reporting.