Alexander Van der Bellen, who preached moderation and tolerance, has won Austria's presidential election over right-wing populist Norbert Hofer.
Preliminary results, released shortly after the polls closed on Sunday, showed Van der Bellen, former head of the Greens, with 53.5% of the vote and Hofer having 46.4%.
Hofer said in a Facebook post that he was "endlessly sad" about his loss, adding: "I would have been happy to take care of our Austria."
He congratulated his rival and urged Austrians to "stick together and to work together".
While the final result will not be official until absentee votes are counted on Monday, officials said the outstanding ballots will not change the outcome, even if the percentages the candidates won may vary.
The Austrian president's functions are largely ceremonial and past elections have merited little attention outside the country because they were decided between mainstream candidates.
This time though, the contest was different because the vote was seen as an indicator of how well Eurosceptic candidates will do elsewhere in the EU next year.
Van der Bellen is pro-European Union and represents liberal to left-of-centre views while Hofer comes from the Eurosceptic anti-migrant Freedom Party.
His campaign message has varied from hard-line when talking to Freedom Party supporters to more moderate when trying to woo undecided voters disenchanted with the political establishment.
The election was a rerun from May, which Van der Bellen won by less than one percentage point. It was re-held following a court ruling after Hofer's Freedom Party claimed widespread irregularities.