Far-right candidate Norbert Hofer has conceded defeat in the Austria's presidential election. He had led over former Green Alexander van der Bellen by a wider margin, before the counting of absentee ballots.
Europe came within a hair of having its first far-right head of state in the post-war era, but Austria's Interior Minister Wolfgang Sobotka announced that right-wing Freedom Party candidate Norbert Hofer had lost the second round run-off election to Alexander van der Bellen after more than 700,000 absentee ballots were counted.
The margin of victory was 31,000 votes, out of more than 4.6 million ballots cast, with Van der Bellen winning 50.3 percent. Turnout was 72.7 percent.
But in conceding defeat, Hofer said Austria's far-right would live to fight another day.
Voting on Sunday ended with Hofer, 45, narrowly ahead of independent candidate Van der Bellen, 72, who was backed by the Green Party.
Both candidates left the public underwhelmed, with many voters citing Van der Bellen as the less objectionable one.
"He's the lesser evil of the two," was a commonly heard phrase at polling stations in Vienna, and Van der Bellen even used this pitch to undecided Austrians.
"I ask all those who don't like me but perhaps like Hofer even less to vote for me," he pleaded ahead of Sunday's runoff. "Otherwise we run the risk of not recognising Austria if Norbert Hofer becomes president."
Despite those pleas voters who cast their ballots in-person gave Hofer a 3.8 percent advantage: 51.9 - 48.1 percent.
In a low-key victory speech Van der Bellen said there are too many Asutrians who feel their government isn't listening to them.
"A lot of people in this country don't feel sufficiently represented, they don't feel heard," he said.
Van der Bellen said his aim is to have his countrymen feel better about their country and future by the time his term in office ends.
"My aim is to be a constructive partner of the federal government and the parliament," he said, "so that in six years people in Austria feel better and that people will be able to say,' my children have a good future' and 'I can look to the future with hope.' "
The mass migration of Muslim refugees from war-torn countries such as Syria and Iraq have stoked nationalist ferver, and fears, among the working class in the country of 8.6 milion.
While 86 percent of working class voters pulled the lever for Hofer, 81 percent with university degrees backed Van der Bellen.
Austria took in nearly 100,000 refugees last year.
But the 700,000 mail-in ballots, representing about 10 percent of the electorate, were decisive in determining the winner.
A large majority of the absentee ballots came from better educated voters, who overwhelmingly backed Van der Bellen.
Austria’s presidency is a largely ceremonial position but the office holder does have the power to dissolve the Cabinet.
Austria has been ruled by a left-right duopoly for much of its post-war history. The Social Democrats (SPO) lead a coalition government with their conservative counterpart, the People’s Party (OVP).
But both mainstream parties failed to get their respective candidates into the final round of the presidential election.