(CNN) Austria's presidential election ushered in a profound change in the country's political landscape, dominated by two centrist parties since the end of World War II.

Left-leaning candidate Alexander Van der Bellen narrowly defeated far-right candidate Norbert Hofer to become Austria's next president, a tightly fought contest decided by mail-in votes.

The win placed Austria at the head of a populist groundswell sweeping Europe amid rising frustration over the European Union's failure to deal with the ongoing economic and migrant crises.

The victory held off Hofer, of Austria's Freedom Party, from becoming the European Union's first far-right head of state.

Austrian Interior Minister Wolfgang Sobotka announced the results Monday in Vienna, revealing that Van der Bellen had won 50.3% of the ballot (2,254,484 votes) to Hofer's 49.7% (2,223,458 votes).

Van der Bellen, a 72-year-old economist, ran as an independent, although the Green Party, of which he was a former leader, financially backed his campaign.

A Hofer victory would have been hugely encouraging to other far-right parties across Europe, such as France's National Front, the Danish People's Party and Germany's AFD, Jeremy Cliffe, political correspondent for The Economist, told CNN.

Alexander Van der Bellen (L) and Norbert Hofer (R)

Anti-migrant platform touched a nerve

The migrant crisis radically altered the race.

When Germany opened its borders to migrants in September last year, Austria followed suit and was applauded internationally for the welcome it gave thousands of migrants who had been trapped in their attempts to transit through Hungary, which was widely criticized for its hard-line stance in defending its borders.

But eight months on, almost half of the Austrian population has expressed its support for a party that campaigned on a Euroskeptic, anti-migrant and anti-establishment platform.

It's a meteoric rise for the Freedom Party which has had a checkered history.

In 2000, the European Union slapped sanctions on the party when under the late Joerg Haider, it entered a coalition government that ultimately collapsed.

At the time, thousands of Austrians protested the Freedom Party's place in their parliament with demonstrators labeling Haider a fascist.

Sixteen years on, Hofer is batting away the same accusations.

"I am not, because you will see," he said when a reporter asked him how he felt about being called a Nazi. "You have to take a look at me, where I am in one or two years. I have to work and then everybody will see I am really OK. I am not a dangerous person, of course."

Few people outside the Freedom Party had even heard of Hofer before the presidential election.

Now he has been catapulted into the spotlight and Austrian voters will be watching to see if his party's populist momentum can carry through to the next parliamentary elections due within the next two years.

The rest of Europe, meanwhile, will also be paying attention as nationalist parties within their own borders try to capitalize off what the Austrian presidential election result has delivered -- hope that they, too, can emerge from the fringes.

A nail-biting race

The Sunday poll was so close that Austrians had to wait until all the postal votes were counted on Monday before Hofer conceded defeat on his Facebook page.

"Of course I'm sad today," he wrote. "The effort that went into this campaign isn't lost but is an investment in the future."

In the end, the Freedom Party had lost by just over 61,000 votes and Austria had come nail-bitingly close to electing the European Union's first far right head of state.

Instead, they voted in a left-leaning independent science professor and former member of the Green Party.

"Above all the political difference, for all the people in this country. I will be a president, a comprehensive president," Van der Bellen told reporters after his victory was announced.

Hofer had held a narrow lead in the neck-and-neck race on Sunday evening, with 51.9% of the vote to Van der Bellen's 48.1%, according to Austria's Interior Ministry.

In the end, the race was decided by more than 700,000 mail-in votes, accounting for 14% of eligible voters.

Van der Bellen, who fared better with urban voters, had been expected to secure more of the mail-in votes than his 45-year-old rival, a trained aeronautical engineer, who drew strong support in rural areas. Hofer had won 35% in the first round of voting last month to Van der Bellen's 21%.

In a Facebook post conceding to Van der Bellen on Monday, Hofer said he was thankful for the opportunity given, urged voters not to despair and said he would have been happy to take care of the country.

Centrists eliminated

The campaign was notable for the "polarization" of the political landscape, the Economist's Cliffe said.

Candidates backed by the two centrist parties who had dominated Austrian politics since World War II -- the left-leaning Social Democratic Party and conservative People's Party -- had been eliminated in the first round of voting, resulting in a situation where the center was "really nowhere to be seen."

JUST WATCHED Austria passes stringent new asylum laws Replay More Videos ... MUST WATCH Austria passes stringent new asylum laws 02:34

This was due to public disillusionment with the centrist parties -- seen as too "cozy" and "complacent" -- combined with the migrant crisis, which had been a key issue on the campaign trail, over which Van der Bellen and Hofer had clashed.

"You're left with this clash between quite a conventionally left-wing politician in Mr. Van der Bellen and a far-right politician, Mr. Hofer."

While Hofer's Freedom Party campaigned against migration, Van der Bellen -- whose parents spent time in a refugee camp before settling in Austria -- has championed liberal migration policies.

He had told voters during the campaign: "I've experienced how Austria rose from the ruins of World War II, caused by the madness of nationalism."

Last month, Austria passed controversial new laws -- among the toughest European responses to the migrant crisis -- restricting the right of asylum.

The laws, which would allow authorities to turn away most migrants at the border if a state of emergency is invoked, reflected hardening attitudes toward migrants in Austria, which has been erecting security fences along its borders.

Hofer wanted to transform role

Cliffe said the role of president in Austria has traditionally been largely ceremonial, a head of state with formal constitutional powers that by convention aren't used.

Hofer had indicated he wanted to change this, he said. The incumbent president, Heinz Fischer, was unable to run again after two terms in office.