The Constitutional Court dismissed the challenge, however, saying Chamisa hadn’t provided enough evidence to prove fraud.
Mnangagwa’s inauguration is due to take place on Sunday but he will be presiding over a divided nation.
Writing on Twitter, President Emmerson Mnangagwa said his door was open and his arms extended to Nelson Chamisa.
This appeared to be an olive branch after a bruising court battle.
Chamisa’s lawyers had alleged fraud during the 30 July poll.
But a nine-member bench of the constitutional court on Friday ruled that Chamisa hadn't supplied what it termed "clear, direct, and sufficient evidence" to support the claim.
The court dismissed the application and declared Mnangagwa to be duly elected president.
The 75-year-old leader will be sworn in on Sunday.
There had been fears a ruling against the MDC would trigger violent protests, last seen on August the first when the army responded by killing six people in central Harare.
In a statement the MDC said it respected the court’s ruling with a heavy heart, and Chamisa appeared to leave the door open for some other future action.
I hear your cries & feel your pain. I know you feel cheated, but take heart — your victory is not lost. Your will is sacred & we’ll listen to you on the path of peace & course of action to be taken to rescue our beautiful Zimbabwe from the jaws of poverty, corruption & dishonestyNelson Chamisa (@nelsonchamisa) 24 août 2018
In a tweet he said he would listen to his supporters on what to do next to rescue the country from what he said were the jaws of poverty, corruption and dishonesty.