Image copyright EPA Image caption Alexander Van der Bellen (l) beat Norbert Hofer (r) by only 30,863 votes in the election

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."

What were the complaints?

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.

Image caption The decision was announced by the Constitutional Court

What is at stake?

If elected, Mr 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, Mr Hofer said he favoured holding a similar referendum in Austria if the bloc failed to stop centralisation and carry out reforms "within a year".

Last Sunday, he told the Oesterreich newspaper (in German): "If [the EU] evolves in the wrong direction, then in my opinion the time has come to ask the Austrians if they still want to be part of it."

His opponent, Mr Van der Bellen, is strongly pro-EU and has spoken of his dream for a border-free "United States of Europe".

The two men went forward to a run-off when, for the first time since World War Two, both the main centrist parties were knocked out in the first round of voting.

Following the court's order to re-run the vote, President Heinz Fischer will be replaced on a temporary basis by three parliamentary officials, including Mr Hofer.

The new election is expected to be held in September or October.

What powers does the Austrian president have?

It is a mostly ceremonial post. But the president does have the power to dissolve the National Council - the more powerful lower house of parliament. That triggers a general election.

The president can only do that once for a particular reason - he cannot use the same grounds to dissolve it again.

It is the chancellor's job to appoint government ministers. And the chancellor has the power to dismiss the government. But ministers have to be formally sworn in by the president.

Vying to lead Austria

Norbert Hofer

Image copyright EPA

Age: 45

Background: Aeronautical engineer

Politics: Far-right Freedom Party

Campaign soundbite: "To those in Austria who go to war for the Islamic State or rape women - I say to those people: 'This is not your home'."

Alexander Van der Bellen

Image copyright AFP