Austria’s highest court has annulled the result of the presidential election narrowly lost by the candidate of the far-right Freedom Party.
The party had challenged the result, saying that postal votes had been illegally and improperly handled.
The Freedom Party candidate, Norbert Hofer, lost the election to the former leader of the Greens, Alexander Van der Bellen, by just 30,863 votes or less than one percentage point.
The election will now be re-run.
Announcing the decision, Gerhard Holzinger, head of the Constitutional Court, said: “The challenge brought by Freedom Party leader Heinz-Christian Strache against the 22 May election… has been upheld.”
He added: “The decision I am announcing today has no winner and no loser, it has only one aim: to strengthen trust in the rule of law and democracy.”
Will Brexit matter, asks Bethany Bell, BBC News, Vienna
Austria’s politics have been thrown into confusion. One of the most controversial and polarising presidential elections in recent history will have to be re-run.
This is a moral victory for the far-right, anti-immigrant and Eurosceptic Freedom Party, which launched the legal challenge last month after alleging “terrifying” irregularities.
The Freedom Party is hoping that the decision by the court will help its candidate Norbert Hofer win in the new election this autumn.
Hanging over the vote is the shadow of “Brexit” – the UK’s decision to leave the EU.
Will Mr Hofer choose to make Austria’s future membership of the EU a campaign issue?
Some Austrians think the vote by the United Kingdom to leave the EU could boost populist and nationalist sentiment in Austria. Others believe the political turbulence in Britain may make people more cautious about Eurosceptic parties.
Mr Hofer said on Friday he was pleased that the court had taken “a difficult decision”, adding: “I have great trust in the rule of law.”
Mr Van der Bellen said he was “very confident” he would emerge the winner.
“Austria needs to be well represented in Europe and the world. If we can do it once, we can do it again,” he told reporters.
Austrian Chancellor Christian Kern said the court ruling showed that the country’s democracy was strong and he called for “a short campaign, a campaign without emotions”.
In two weeks of hearings, lawyers for the Freedom Party argued that postal ballots were illegally handled in 94 out of 117 districts.
It alleged that thousands of votes were opened earlier than permitted under election rules and some were counted by people unauthorised to do so.
The party also claimed to have evidence that some under-16s and foreigners had been allowed to vote.
In its ruling, the court said election rules had been broken in a way that could have influenced the result.
But it said there was no proof the count had been manipulated.