Malawi’s top appeals court on Friday rejected President Peter Mutharika’s bid to scrap the annulment of controversial elections last May which he narrowly won, paving the way for a rerun in July.

Mutharika had appealed a landmark decision by the Constitutional Court to nullify the results of the disputed May 21 election over what it said were “grave” and “widespread” irregularities.

The president had garnered just 38.5 percent of the vote to win a second term.

“We have listened to the petitions by the two parties and we dismiss both the appeals in their entirety,” said Justice Frank Kapanda, referring to the president’s appeal as well as a similar case filed by Malawi’s electoral commission.

In his appeal, Mutharika said the judges had “erred in law”.

“We find that the first appellant (Mutharika) was not duly elected to the office of the president,” said Kapanda, one of seven judges who read out the ruling in the capital Lilongwe.

“The conduct of the electoral commission left a lot to be desired,” Kapanda said. “There was a lack of seriousness and incompetence.”

The Malawi Electoral Commission (MEC) had also sought to overturn the election it organised.

The rerun is scheduled for July 2.

Three candidates including Mutharika filed their nomination papers this week