Leonhard Foeger/Reuters Austrian far-right Freedom Party (FPOe) presidential candidate Norbert Hofer waits for the first projections in his office in Vienna, Austria, on Dec. 4, 2016.

VIENNA, Dec 4 (Reuters) - The candidate vying to become Europe’s first freely elected far-right head of state since World War Two conceded defeat in Austria’s presidential election soon after polls closed on Sunday evening.

The result is a blow to populists who had hoped a wave of anti-establishment anger sweeping Western democracies would carry Norbert Hofer to power after Britain’s Brexit referendum and Americans’ election of Donald Trump as president.

Hofer, of the anti-immigration and anti-Islam Freedom Party (FPO), conceded he had been soundly beaten by former Greens leader Alexander Van der Bellen.

“I am infinitely sad that it didn’t work out,” Hofer said in a posting on his Facebook page less than an hour after polls closed and the first projections were broadcast.

Austria’s president traditionally has a largely ceremonial role. But the election, a re-run of a May vote that was overturned due to counting irregularities, had been seen as another test of populist sentiment in Europe ahead of elections in France, Germany and the Netherlands next year.

Voters may have heeded Van der Bellen’s increasingly strident warnings that Hofer wanted to follow Britain’s lead and pull Austria out of the European Union.

Van der Bellen had a clear lead over Hofer, according to a projection by pollster SORA for broadcaster ORF that included a count of 69 percent of votes. The projection showed Van derBellen on 53.3 percent and Hofer on 46.7 percent, with a margin of error of 1 percentage point.

“Should this projection really be true, at which point we can be pleased, it is a good day for Austria,” Van der Bellen’s campaign manager Lothar Lockl told ORF minutes after polls closed.

EU MEMBERSHIP

When Hofer narrowly lost the original run-off in May with 49.65 percent of the vote, European governments breathed a sigh of relief. Far-right parties like France’s National Front cheered the record performance. Opinion polls had suggested the re-run was too close to call.

A Hofer win would have raised the prospect of two near-simultaneous blows to Europe’s political establishment. Italy is holding a referendum on Sunday on constitutional reform that could decide the political future of Prime Minister Matteo Renzi, who has promised to resign if he loses.

While the president’s role is traditionally largely ceremonial, Hofer had made clear he wanted to be an interventionist head of state, threatening to dismiss a government if it raises taxes and calling for referendums on a range of issues, even though referendums are beyond the job’s remit.

The president also plays an important part in forming coalitions. Van der Bellen has said he would try to prevent an FPO-led government even if it won an election. The FPO is running first in polls with support of roughly a third of voters, with parliamentary elections due in 2018.

Van der Bellen, 72, put Brexit at the heart of his campaign, arguing that Hofer wants Austria to hold its own “Oexit” referendum, putting jobs at risk in the small, trade-dependent country.

The result of the May 22 run-off was overturned mostly due to election officials cutting corners as they raced to complete the count. The re-run was then postponed because the glue on the envelopes for some postal ballots did not stick.

(Additional reporting by Sasa Kavic and Branko Filipovic in Pinkafeld, Austria, and Shadia Nasralla and Kirsti Knolle in Vienna; Editing by Susan Fenton and Pravin Char)