Pro-European and left-leaning politician Alexander Van der Bellen soundly defeated his far-right rival for Austria's presidency on Sunday, in a re-run election that left mainstream leaders across the continent breathing sighs of relief.
Green candidate Van der Bellen received 53.3 per cent of the vote to Norbert Hofer's 46.7 per cent, according to a projection by public broadcaster ORF based on 99.9 per cent of counted ballots.
The election captured international attention, as a victory for Hofer in the wake of Britain's vote to leave the European Union could have boosted similar far-right eurosceptics across the bloc.
"It is possible to win with pro-European positions," said 72-year-old Van der Bellen, who has called for a more unified Europe in the wake of Brexit and Donald Trump's US election victory.
His EU stance was the most important reason why his voters supported him for the largely ceremonial office, according to a poll that was conducted shortly before and on election day.
"Van der Bellen's victory is a heavy defeat of nationalism and anti-European, backward-looking populism," EU Parliament President Martin Schulz wrote on Twitter.
"This takes a great load off our minds," Germany's Vice Chancellor and Social Democratic party chief Sigmar Gabriel tweeted.
It was the second win for Van der Bellen in this unusual presidential race.
The pro-European Green economist had already won in May with 50.3 per cent.
However, Hofer's Freedom Party had successfully appealed the result, as procedural voting irregularities were uncovered in many towns.
Hofer conceded defeat before all ballots were counted, in a message that sought to heal political divisions after a heated one-year campaign.
"I congratulate Alexander Van der Bellen and ask all Austrians to stick together," said 45-year-old Hofer, who currently serves as a deputy president of parliament.
Eurosceptic populist parties in Germany, the Netherlands and France had placed their hopes on Hofer.
He is opposed to an Austrian referendum to leave the EU, but he advocates popular votes in case Turkey joins the EU or in case the bloc becomes more centralized.
Despite Hofer's loss, France's far-right Front National leader Marine Le Pen nevertheless congratulated the Freedom Party. "The next legislative elections will mark their victory," she wrote on Twitter.
While he may not have won the presidency, Hofer can claim the best election result for his Freedom Party in a national vote.
The opposition party has been leading in national polls for more than a year, putting them in a strong position to win the 2018 parliamentary elections.
"This is not the end of history," Freedom Party secretary general Herbert Kickl said.
"It's an excellent starting position for further elections in Austria," he added.
The presidential candidates of the Social Democrats and the centre-right People's Party, which form the unpopular coalition government, were already defeated in the first-round election in April.
Social Democratic Chancellor Christian Kern reached out to Hofer's supporters Sunday evening.
"It's important that no-one feels like a loser on this day. We all are Austria," he said in a television address.
Van der Bellen's voters include a large share of highly educated voters who feel that the quality of life in Austria will improve in the coming years.
Hofer was got strong support from working-class citizens who think that the country is going downhill, according to an ORF survey.
Austria has been grappling with a stagnating economy and elevated unemployment levels.
Hofer's voter "have perfectly legitimate worries" that must be taken seriously, Van der Bellen said.
The Austrian constitution gives the president more power than many other European countries, including the ability to choose a chancellor. In practice, Austrian heads of state have mostly asked the leader of the strongest party to form a cabinet.
The president can also dismiss the cabinet and install a minority government or a group of experts as ministers instead - but no Austrian head of state has ever done so.
Instead, Austrian presidents usually have taken on a mostly ceremonial, non-partisan role, and they have backed the government's diplomatic efforts by meeting foreign dignitaries.