VIENNA — Though it was just the first round in an election to a mostly ceremonial post, the victory of a far-right politician in Austria’s presidential election on Sunday heralded the demise of the two-party system that has dominated the country’s politics for 70 years.

The candidates of the governing parties, the center-left Social Democratic Party (SPÖ) and the center-right Austrian People’s Party (ÖVP), failed to reach the run-off, each just garnering 11 percent of the vote. In contrast, Norbert Hofer from the Austrian Freedom Party (FPÖ) shot to first place with 35 percent of the vote on the strength of anti-incumbency sentiment and concern over the influx of refugees. In the second round on May 22, he will face the former head of the Green Party, Alexander Van der Bellen, who got 21 percent of the vote.

The federal president does not interfere in day-to-day politics, but he appoints the chancellor and can dismiss the government under exceptional circumstances. The current office holder Heinz Fischer, a former Social Democrat, mostly kept a low profile as did most of his predecessors.

A victory by Hofer in the run-off would for the first time put a representative of the far-right at the helm of a Western European country. National Front Leader Marine Le Pen of France was quick to congratulate Hofer on his success.

The two representatives of the old mainstream parties faced a range of attractive opponents.

The election outcome deepens the malaise of the two governing parties that have faced growing discontent and worsening poll numbers since barely gaining over half the seats in the last parliamentary elections in 2013. SPÖ and ÖVP governed Austria either alternately or jointly since 1945, but have seen their share of the vote gradually decline since the FPÖ started to rise under its controversial late leader Jörg Haider in the 1980s.

A joint share of only 22 percent of the popular vote is worse than anybody could have ever feared. The disastrous outcome for Rudolf Hundstorfer, 64, the SPÖ candidate, and Andreas Khol, 74, from the ÖVP has several causes beside the migrant crisis, analysts were quick to point out: A general decline in the support of traditional parties in all industrialized countries, discontent with weak economic growth and rising unemployment, anger about coalition infighting and two relatively unattractive candidates.

Hundstorfer, a jovial former social affairs minister and trade union leader, failed to appeal beyond his trade-union constituency. Khol, a veteran political operative, was his party’s second choice after Erwin Pröll, the influential provincial governor of Lower Austria, withdrew his widely expected candidacy.

The two representatives of the old mainstream parties faced a range of attractive opponents. Former supreme court judge Irmgard Griss, 69, who ran a spirited independent campaign, garnered 19 percent of the vote that appealed to moderate and conservative voters. Van der Bellen, who is 72, is a level-headed economist who is respected well beyond typical Green and left-wing voters.

The biggest surprise of the campaign was the little-known Hofer, 44, who presented a soft and amicable face for his party’s hardline policies on immigration and law and order. He appealed to voters turned off by the rabble-rousing style of party chairman Heinz-Christian Strache.

Both Hofer and Van der Bellen benefited from the recent migrant crisis. Last year, Austria allowed hundreds of thousands of refugees from the Middle East to enter the country from Hungary and Slovenia after crossing the Mediterranean from Turkey to Greece and moving north via the Balkan route. Most of them went on to Germany, attracted by Chancellor Angela Merkel’s open-door policy, but around 90,000 applied for asylum in Austria, straining the country’s resources and public empathy. The FPÖ vehemently opposed the government’s original “welcoming culture” and since last summer led all opinion polls.

In the government, the ÖVP soon pushed for a more restrictive immigration policy, but was rebuffed by SPÖ Chancellor Werner Faymann, who remained loyal to Merkel. Then this year, Faymann changed his mind, agreeing to strict limits on asylum seekers and encouraging Macedonia and other Balkan countries to close their borders. The U-turn angered the party’s urban liberal wing that wanted to keep the borders open, and was criticized by others for coming too late.

Hundstorfer defended the new border policy in his campaign, but saw his support slipping away both to Hofer and Van der Bellen, who strongly opposed the limits on asylum.

His massive defeat could jeopardize the position of Faymann, one of the EU’s longest-serving heads of government. The party is torn over immigration and its relationship to the FPÖ. For decades, the SPÖ refused to cooperate with the far right, citing its historical roots in Nazi ideology and xenophobia. But last year, the party organization in the most eastern province of Burgenland ignored the official line and formed a coalition with the local FPÖ. Faymann’s attempt to paper over this split has been made harder by his falling popularity and this latest electoral result.

Both Faymann and his vice-chancellor, ÖVP leader Reinhold Mitterlehner, are expected to hang on to their jobs for a while, though neither may lead their respective parties into the next parliamentary election in 2018. Both parties are promising a “fresh start” with less bickering and more decisive reforms. The dynamics of the coalition with the parties’ long-standing rivalry and its very different social constituencies makes such a change in style unlikely.

The outcome of the presidential run-off will mostly depend on Van der Bellen’s ability to turn the vote into a referendum on the far right.

A comparable outcome in the 2018 poll would put the FPÖ into the driver’s seat and make Strache the next chancellor. It is unclear, however, whether either SPÖ or ÖVP would be willing to join a coalition with him as junior partner, or rather stick together and form a broader coalition with Greens and the liberal NEOS party in order to keep the FPÖ out of power.

When the FPÖ joined a coalition led by the ÖVP in 2000, other EU countries broke off most bilateral contacts to protest Haider’s earlier statements in defense of Nazi policies. Strache, who was an activist on the far-right fringe in his youth, has avoided inflammatory statements. He recently travelled to Israel to distance himself from charges of anti-Semitism.

The outcome of the presidential run-off will mostly depend on Van der Bellen’s ability to turn the vote into a referendum on the far right. “Van der Bellen must form a united front and mobilize the rest of the country against the FPÖ,” says Anton Pelinka, a political scientist. Observers cite the example of the recent French regional elections, when the Front National failed to capitalize on its first-round success because other parties joined forces.

However, Hofer might gain plenty of votes from the supporters of Griss and Khol for whom any Green is just not palatable. “Hofer’s lead is so large, he must be considered the favorite for the run-off,” says Peter Filzmaier, a political analyst.

Hofer promised to take a more active political role as president, dismissing the government if it fails to live up to his expectations and participating in EU summits, a role traditionally taken by the chancellor. “You will be surprised what is all possible,” he said in the final TV debate when asked about the constitutional constraints on the office. This assertive posturing and his relative youth, however, might scare off some voters who prefer the traditional role of a president who acts just as a moral authority.

Eric Frey is managing editor of the Vienna daily Der Standard.

This article has been updated to correct the description of the coalition.