Austria's presidential run-off election must be held again, the country's Constitutional Court has ruled, handing the Freedom Party's narrowly defeated candidate another chance to become the first far-right head of state in the European Union.

The verdict comes a week after Britain delighted anti-EU groups including the Freedom Party (FPO) by voting to leave the bloc. Concerns about immigration and jobs featured prominently in that referendum, as they did in Austria's knife-edge election.

Norbert Hofer of the anti-immigration Freedom Party lost the 22 May vote to former Greens leader Alexander Van der Bellen by less than one percentage point, with postal ballots having tipped the balance in Mr Van der Bellen's favour.

The FPO, which is topping opinion polls ahead of the next scheduled general elections in 2018 on the back of unease about immigration, launched a legal challenge on 8 June because of "massive irregularities".

"It is absolutely clear to the Constitutional Court that laws governing an election must be applied rigorously," the court's 14 judges said in their ruling on a challenge brought by FPO leader Heinz-Christian Strache.

The court said it was using its strict standard on the application of election rules.

Witnesses told the court of various irregularities in the way postal ballots were counted.

These included ballots being processed before the officially ordered start the morning after the election, and counts being carried out in the absence of party observers, often because officials were racing to provide a result quickly.

The court found no proof that the result had been manipulated but the possibility that the outcome might have been affected is enough for a challenge to succeed.

The re-run will reopen a debate that split Austria almost evenly, pitting town against country, and blue-collar workers worried about immigration and falling living standards against the more highly educated.

The irregularities that have come to light have dismayed the Austrian public.

"There was sloppiness," Austrian Interior Minister Wolfgang Sobotka, whose ministry oversees elections and was accused by several witnesses of applying pressure on officials to provide a rapid count, told reporters after the verdict.