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 improperly handled.
The Freedom Party candidate, Norbert Hofer, lost the election to the former leader of the Greens, Alexander Van der Bellen, by less than a percentage point.
The election will now be re-run.
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.
If elected, Hofer will become the first far-right head of state of an EU country.
His party has based its election campaigns around concern over immigration and falling living standards for the less well-off.
After Britain voted to leave the EU, Hofer said he favoured holding a similar referendum in Austria if the bloc failed to stop centralisation and carry out reforms "within a year".