Austrians have elected Alexander Van der Bellen, a former leader of the Greens party, as president in a closely watched vote that nearly brought the first-ever far-right head of state to power in an EU member state.
After an election on May 22 that was too close to call, Austrian officials counted hundreds of thousands of postal ballots that ended up lifting Van der Bellen past Freedom Party rival Norbert Hofer.
The result averts an embarrassing setback for Europe's political establishment, which is threatened by rising populist and anti-EU parties that have capitalized on public concerns about the continent's migration crisis and years of weak growth and high unemployment.
Interior Minister Wolfgang Sobotka said Van der Bellen collected 50.3 percent of the Austrian vote compared to 49.7 percent for Hofer, who had run on an anti-immigration platform.
Preliminary results late on May 22 had put Hofer 3.8 percentage points ahead in the runoff for the largely ceremonial Austrian presidency.
But the paper-thin margin was erased after a record 700,000 postal ballots were counted on May 23, leaving Van der Bellen just over 31,000 votes ahead in the final tally of more than 4.6 million ballots.
Many observers expected the intellectual Van der Bellen, 72, would fall to his younger rival after lagging 14 points behind him in the first round on April 24.
Hofer conceded defeat in a post on his Facebook page, thanking his supporters and telling them not to be discouraged. "Of course I am sad today," he said. "I would have liked to take care of our wonderful country for you as president."
The vote in Austria, a country of 8.5 million people, had unsettled leaders elsewhere in Europe, particularly in neighboring Germany, where a new anti-immigration party, the Alternative for Germany (AfD), is on the rise.
In France, the National Front of Marine Le Pen is leading in polls ahead of a presidential election next year.
French Prime Minister Manuel Valls immediately voiced his "relief" that Van der Bellen had triumphed over the far-right challenge. "Relief to see the Austrians reject populism and extremism," Valls tweeted about the result. "Everyone in Europe should learn from this."
Across the Channel, the right-wing U.K. Independence Party is campaigning for Britain to leave the European Union in a referendum on June 23.
EU member Austria has been at the center of a record influx of migrants from the Middle East, fanning public resentment toward the two centrist parties -- the Social Democrats (SPO) and the conservative People's Party -- that have dominated politics since the end of World War II.
Hofer, 45, has described himself as a center-right politician, but his Freedom Party has its roots in Austria's Nazi past. He tapped into anti-EU sentiment and fears about rising numbers of asylum seekers, with millions of Middle Easterners and others fleeing war and instability.
Austria took in 90,000 asylum seekers last year, representing more than 1 percent of its population, many of them shortly after it and neighboring Germany threw open their borders last fall to a wave of migrants including refugees from Syria's ongoing conflict.
The government in Vienna has since clamped down on immigration and asylum, but that about-face only fueled support for the far right.
'Child Of Refugees'
Van der Bellen is an economics professor and former leader of Austria's Greens, who advocate environmental protection and minority rights, among other things.
He revealed that he himself was a "child of refugees who has received a lot from Austria." He was born in Vienna to an aristocratic Russian father and an Estonian mother who had fled Stalinism.
Van der Bellen struggled to convince many conservative voters, who suspected him of pandering to the left.
They have also accused Van der Bellen of being a "turncoat" because he was a member of the Social Democrats before joining the Greens in the early 1990s.
An outspoken supporter of gay marriage, the divorced and recently remarried father of two is known as "The Professor" or "Sascha," a diminutive of Alexander, in reference to his Russian roots.
In his private life, Van der Bellen admits to two weaknesses: Donald Duck comics and cigarettes.
"I once quit for four months...but why should I torture myself at my age?" he said.
With reporting by Reuters, AFP, AP, and dpa