Left-leaning candidate Alexander Van der Bellen won the election to become Austrian president Monday, but his right-wing rival was only narrowly behind, a result that reflects the growing strength of Europe's anti-EU political movements.

Right-winger Norbert Hofer had been narrowly ahead of Van der Bellen, a Greens politician running as an independent, after the counting of votes cast on Sunday. But around 700,000 absentee ballots still remained to be counted Monday, and those numbers swung the victory to Van der Bellen.

Interior Minister Wolfgang Sobotka said Van der Bellen collected 50.3 percent of the votes compared with 49.7 percent for Hofer of the Freedom Party. Only a little more than 31,000 votes separated the two, out of more than 4.6 million ballots cast.

The results ease the scenario that Austria's political landscape could immediately move away from its EU-friendly image with a president who could increase pressure on the government to further tighten its migrant polices. Still, the narrow margin of victory for Van der Bellen is the latest indication that Europe's anti-establishment parties are gaining in influence.

Hofer announced his defeat shortly before the official announcement in a Facebook post thanking his backers for their support.

He acknowledged he is "naturally sad," adding: "I would have been happy to have cared for our wonderful country as federal president." His post said that the work of his supporters during the election is "not lost but an investment in the future."

Hofer's Freedom Party has exploited anti-EU sentiment and fear that Austria could be overrun by refugees to become the country's most popular political force. Van der Bellen was generally supported by pro-European Union Austrians favoring humane immigration policies.

Sunday's voting revealed a profound split over which direction the nation should now take, particularly over migration and the EU's future. And even with a Hofer loss, his strong showing reflects the growth of support for anti-establishment parties across the continent to the detriment of the political middle.

Slovak Foreign Minister Miroslav Lajcak, a Social Democrat, described it as "a continuation of a trend."

"People are dissatisfied with the traditional, standard political parties," he said on arrival at an EU foreign ministers' meeting in Brussels. "I really believe it's time for us to reflect upon it because we must be doing something wrong."

Mirroring the depth of Austrian dissatisfaction with the status quo, candidates of the Social Democrats and the centrist People's Party -- the two parties that form the government coalition -- were eliminated in last month's first round of voting.

Those parties have dominated Austrian politics since the end of World War II and winners of all previous presidential elections since then have been backed by one of the two.