BERLIN — Austria became the latest European country to take a sharp turn right on Sunday, with the conservative People's Party riding a hard-line position on immigration to victory in national elections and likely to form a government with a nationalist party that has long advocated for an even tougher stance.
The result puts the 31-year-old foreign minister and People's Party leader, Sebastian Kurz, in line to become Austria's next chancellor after a campaign in which he emphasized the need to strengthen border controls, reduce caps on refugees and slash benefits for newcomers.
With nearly all results counted as of Monday morning, the Freedom Party was in second place at 27.4 percent, with the ruling Social Democrats trailing close behind at 26.7 percent. The People's Party was the decisive winner, at 31.6 percent.
"I'll fight with all my strength for change in this country," Kurz told cheering supporters — many clad in turquoise, the color he adopted to signal a new era for the People's Party after decades of identification with black. "There's a lot to do."
Two years after Austria was among the more welcoming nations in Europe for refugees fleeing en masse across the continent, the results revealed just how sour public sentiment has turned. Hundreds of thousands of people fleeing war, oppression and poverty passed through the central European nation on their way to destinations farther north and west in late 2015 and early 2016. Tens of thousands stayed in the country and applied for asylum protection.
"Austrians are fearful because of immigration and the refugee crisis," said Reinhard Heinisch, a political scientist at the University of Salzburg. "Kurz addressed these fears, and played with these fears."
As in other elections across Europe this year, the far right made significant progress, but not enough to triumph.
In France this spring, National Front leader Marine Le Pen made it to the final round of the presidential election. Just last month, the Alternative for Germany Party took 13 percent of the vote — putting a far-right party in the German Parliament for the first time in more than half a century.
But unlike in those nations, in Austria the far right is expected to become part of the government. Kurz will need a coalition partner to form a majority in the parliament, and the Freedom Party is considered the most likely option.
If he goes that route, it would end a "grand coalition" between Austria's center left and center right that has led the country for the past decade, and for much of its modern history.
Some on Sunday called on Kurz to avoid teaming up with the Freedom Party.
"We strongly urge Mr. Kurz to form a coalition of centrist parties and not be beholden to a party of the far-right in his new coalition government," European Jewish Congress President Moshe Kantor said in a statement. "A party which has run on a platform of xenophobic intolerance and the targeting of immigrants must not be granted a seat at the governing table."
The Freedom Party, whose first leader was a former SS officer and whose current leader was a onetime neo-Nazi youth activist, has been in government before; it teamed with the People's Party for five years starting in 2000. At the time, the European Union imposed sanctions against Austria to show its displeasure with a government that included a party long relegated to the fringe.
But in a measure of how far Europe has shifted to the right, no one is contemplating sanctions today.
Freedom Party backers were in a jubilant mood Sunday night, eating schnitzel, dancing to Austrian folk music and waving flags at the party's election-night celebration. Heinz-Christian Strache, the party leader, said the results proved that "our message has reached the mainstream."
That was evident not only in the party's results, but also in the influence that it had over its rivals, who adopted many of the party's positions as their own.
Kurz, who would be the world's youngest head of government, frequently boasted that as foreign minister he had closed the Balkan route for asylum seekers in the spring of 2016 by shutting Austrian borders to new arrivals. He has promised to pressure Europe to do the same now with the central Mediterranean route, the main path for migrants and refugees seeking to enter the continent.
"If there's one topic that really dominated the campaign, it's migration and integration," said Sylvia Kritzinger, a political analyst at the University of Vienna. "Especially with Kurz, it always came back to immigration. We had very little discussion of the issues beyond that."
The Social Democrats, the traditional party of the center left, had attempted to shift the debate onto friendlier terrain by emphasizing the robust health of the economy during their decade in government.
The party on Sunday appeared to have avoided the distant third-place finish that some polls had projected, with its almost exactly even finish with the Freedom Party representing a modest surprise.
But Sunday's result is almost certain to end the chancellorship of incumbent Christian Kern.
In an interview with broadcasters Sunday evening, he said the Social Democrats were "not thrilled with this result, but we can live with it." He ascribed the party's challenges to forces that are buffeting center-left parties across the West.
"We've seen a move to the right in this election. It's not a time that favors social democrats," he said. "We've seen that in all of Europe."
Kern hinted that the party would be willing to serve in a coalition government. But analysts consider such a possibility unlikely given the rightward tilt of the electorate — as well as the bad blood that developed between the two establishment parties after a scandal involving fake Facebook pages that smeared Kurz and were attributed to a Social Democratic operative.
The elevation of Kurz to chancellor would put another young and charismatic leader at the helm of a European government, after the election of 39-year-old Emmanuel Macron in France.
Kurz, though ideologically to the right of Macron, modeled much of his campaign after the Frenchman's. The Austrian politician styled his run for the nation's highest office as a movement, not a conventional election, and personalized his party, informally renaming it "the Sebastian Kurz List."
Kritzinger said Kurz's opponents were flummoxed by how to counteract the charismatic People's Party leader, who took the reins in the party this year and promptly remade it as his own.
"From a rhetoric perspective, he's an absolute talent," Kritzinger said. "The other parties didn't know how to deal with him."