BERLIN—Austria’s Constitutional Court ordered a rerun of the final round of the country’s presidential election, giving Freedom Party candidate Norbert Hofer a second chance of becoming the first right-wing populist head of state in postwar Western Europe.

“The runoff presidential election must be completely repeated in all of Austria,” Gerhart Holzinger, the president of the Constitutional Court, said Friday in Vienna.

The...