Malawi's Supreme Court on Friday in a unanimous decision upheld an earlier court ruling that annulled President Peter Mutharika's narrow election victory last year.
A new election will now be held on July 2, for which three candidates, including Mutharika, filed their nomination papers this week.
The Constitutional Court in February cited "widespread, systematic and grave" irregularities when it annulled the vote that returned Mutharika to power in the southern African nation last May.
Mutharika, 79, and the electoral commission later appealed the Constitutional Court's decision.
In its ruling on Friday, the Supreme Court said, "The various breaches undermined the duties of the Malawi Electoral Commission and grossly undermined rights of voters. None of the candidates obtained a majority."
It added that the electoral commission should not have appealed, as doing so showed it was taking sides.
"The conduct of the electoral commission left a lot to be desired," Justice Frank Kapanda said. "There was a lack of seriousness and incompetence."
Reporting from Harare, Al Jazeera's Haru Mutasa said the top court found Mutharika's appeal "clearly unprofessional and embarrassing".
"Mutharika has always said last year's presidential election was free and fair but the Constitutional Court said there just too many irregularities and some results were changed using typewriter or correction fluid."
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.
On Thursday, Mutharika filed his nomination papers for the July rerun alongside his new running mate Atupele Muluzi, the 41-year old son of former President Bakili Muluzi, who ruled Malawi from 1994 to 2004.
"Together we will be the bridge to the future, together we will win this election," the president told supporters in the city of Blantyre.
Only three of 10 expected candidates have presented credentials to run in the upcoming poll.
Opposition figures Lazarus Chakwera and Saulos Chilima filed their nomination papers on Wednesday.
Mutharika was declared the winner of the disputed elections with 38.5 percent of the vote.
Chakwera's Malawi Congress Party came a close second, garnering 35 percent, while Chilima's United Transformation Movement came third with 20 percent.
The two parties have joined forces under Chakwera's banner to maximise their chances of unseating the president.