Far-right Freedom Party presidential candidate Norbert Hofer, right, and party leader Heinz-Christian Strache wave with Austrian flags during the final election rally in Vienna on April 22. (Leonhard Foeger/Reuters)

He wants to build a fence on the southern border to keep migrants out. He is vowing to “stop the invasion of Muslims.” And although few took his candidacy seriously at first, he has ridden to the cusp of power.

Donald Trump?

Nope. Norbert Hofer.

Analysts call Hofer, the front-runner in Austria’s presidential election this Sunday, part of the transatlantic rebranding of ­populism. By exchanging rabid speeches and hate-filled slogans for more disarming methods, a new breed of Western politician is making nationalistic rhetoric seem not only palatable but even entertaining.

[Meet the Donald Trumps of Europe]

If Trump uses theatrics, Hofer has climbed the polls here with an analogous prime-time panache — coating the populist platform of his Freedom Party in the sugar of an aw-shucks manner. His politics may seem harsh, even cruel. But they are spoken with the winsome smile of a rugged sportsman and the casual familiarity of your next-door neighbor.

At the same time, the 45-year-old former aeronautical engineer is pledging to put “Austria First.” Should he win, it will mark one of the most symbolic victories for the modern far right in Western Europe — and Hofer has tried to assuage fears of what might happen in the country if he does.

‘‘No one needs to be afraid of me,’’ he said.

But many are — including liberal artists, Muslims and others who have been targets of the far right’s rhetoric. Yet Hofer has positioned himself as the anti-establishment candidate, a figure outside the political class that many voters think of as duplicitous and out of touch. He has also tapped into a range of fears currently being reflected on both sides of the Atlantic. Fear of migrants, free trade and globalization. Of a world that gives legal rights to same-sex couples.

Like Trump and his presidential campaign, Hofer is getting a boost from less educated, white, working-class voters — including many who feel left behind and threatened by a fast-changing, multicultural society.

“He knows how to sell,” said Karl Öllinger, a member of Parliament from the Green Party. “That’s what makes him so dangerous.”

Hofer staged a surprise first-place finish in the initial round of voting last month, prompting the sudden resignation of Austria’s center-left chancellor, Werner Faymann. Among likely voters, polls show him in a dead heat with elder statesmen Alexander Van der Bellen, an independent with ties to the Green Party. Hofer is polling slightly ahead among voters overall, suggesting that turnout will be decisive.

His victory could upend the world of politics in this picturesque country formerly at the core of a formidable empire, offering a test case of what happens when populists rise to the top. Traditionally, the post he is running for — Austria’s president — has been largely ceremonial. But he has vowed to use the latent powers of the office in unprecedented ways.

[Italy may be the next big migrant route]

If the sitting government — a coalition of the two parties that have dominated Austrian politics since the end of World War II — does not successfully control ­migration, Hofer has threatened to exercise the president’s power to fire it, potentially prompting fresh elections that could give his Freedom Party a shot at ­governing. Critics say such a move would be tantamount to a democratic coup in the heart of Europe.

If it rises to power, the Freedom Party has pledged to introduce stricter border controls, step up deportations of rejected asylum seekers and block those who have been accepted for long-term resettlement in Austria. It wants to introduce mandatory language classes for immigrants, begin “monitoring” Muslim institutions such as mosques and schools, and exclude homosexuals from the right to marry or to adopt children.

Some observers have tied Hofer’s rise to historical far-right roots in Austria, a country charged with never quite dealing with its Nazi sympathies during World War II. Yet other analysts suggest a phenomenon more similar to the one that has millions of Americans supporting Trump.

“We have a huge problem with immigration and crime,” complained Andreas Nutz, 43, a waiter and Hofer supporter who was enjoying a cigarette on a Vienna sidewalk. “And it’s a problem to deport people.” He added, “Many people are disillusioned with politics.”

[Tracing the path of four terrorists sent to Europe by the Islamic State]

Last year, Austria saw the arrival of nearly 90,000 asylum seekers from the Middle East and beyond. Initially, the ruling coalition here took a humanitarian stance. But that changed this year when the Austrians moved to shut down migrant flows amid a strong public backlash.

“The misperception is that the Freedom Party’s rise is clearly linked to the Nazi roots of Austria, but what’s happening is more complex,” said Reinhard Heinisch, head of the political science department at the University of Salzburg. “This is about globalization. About migrants. It’s about throwing the rascals in power out.”

Still, there is no denying the Freedom Party’s far-right pedigree. In the 1990s and 2000s, international condemnations rained down on its then chief — Jörg Haider, who was known for his thinly veiled flattery of Adolf Hitler. Hofer, by comparison, has sought to cleanse the party of overt anti-Semitism, even making a trip to Israel.

Yet, his asides and gestures have sent mixed signals. During the opening of Parliament, Hofer, for instance, proudly wore a blue cornflower — a nationalist symbol once used by the Nazis. Last week, Hofer startled his opponent by bringing up his past association with the Freemasons — an organization that some here view as connected to conspiracy theories of Jewish influence.

Johann Gudenus, the vice mayor of Vienna, who hails from the Freedom Party, bristled when asked whether Hofer, by wearing a cornflower, was playing to extremists.

“The cornflower? It is a symbol of freedom,” Gudenus said. “It’s like saying, ‘I can’t do anything because the Nazis did it.’ So I guess I can’t drive a Volkswagen or wear a Hugo Boss suit either?” Instead of condemning the Freedom Party, he said, critics should look elsewhere: “The new fascism in Europe is Islamism.”

By contrast, Van der Bellen, the son of immigrants who fled the Soviet annexation of Estonia, is calling on Austrians to embrace tolerance. But in a brief interview, he said he understands why Austrians are mad. “There’s a sense of revolt against the establishment,” he said.

Austria is also an example of how the far right is trying to ditch its old image as a conglomeration of skinheads and undereducated racists.

In his nerd glasses and fashionable turtleneck, Martin Sellner, 27, a philosophy major and co-founder of the Austrian ­Identitarian Movement, sat in a Vienna cafe this week. He proudly described his three-year-old group as “right-wing hipsters.” Last month, its members stormed a stage at a local university where asylum seekers were acting out a play against xenophobia. Theater organizers say migrants were beaten and injured — allegations Sellner denies.

[Germany is trying to teach refugees the right way to have sex]

Sellner insisted that anti-migrant sentiments were being stoked not by the far right but by incidents such as the brutal slaying in Vienna this month of a 54-year-old Austrian woman, allegedly by a Kenyan migrant.

“I support Hofer because I’m here, but if I were in the United States, I would be on the Trump train,” he said.

As the far right morphs and grows, so too have the fears of progressive Austrians and those in the Muslim community. For a glimpse of the future, they say, one need only look across the border at Hungary, where the right-wing nationalist government of Prime Minister Viktor Orban has launched harassment campaigns against political opponents, gay and lesbian groups, and artists.

Among those concerned is ­Karin Bergmann, director of ­Vienna’s grand Burgtheater, which was used during the Nazi occupation of the 1940s to stage anti-Semitic works. It was recently targeted by Sellner’s group for backing a play against xenophobia. Right-wing protesters scaled its neo-baroque ramparts, then unfurled a banner insulting the theater’s management.

Bergmann said she fears further right-wing pressure if the anti-refugee, anti-Muslim Freedom Party ascends to government.

“One doesn’t want to imagine it because it evokes memories of the 1930s, when right-wing parties stoked up fears and pushed minorities to the margins,” she said. “It could be that certain fears, certain instincts, are stoked up again.”

Stephanie Kirchner contributed to this report.

Read more:

Austrian chancellor resigns amid tensions over migrant crisis

The stunning success of Austria’s anti-immigrant far-right, in one map

Today’s coverage from Post correspondents around the world