South Africa'sSupreme Court of Appeal on Friday upheld a High Court ruling to reinstate hundreds of corruption charges filed against Jacob Zuma before he became president.
Zuma and NPA were ordered to pay the costs of the case.
State prosecutors set aside the charges in April 2009, paving the way for Zuma - who has faced and denied numerous corruption allegations made since then - to run for president later that year.
The judgment was handed down in Bloemfontein on Friday morning.
He said the picture that emerged was one in which Deputy National Director of Public Prosecutions Willie Hofmeyr and Mpshe were "straining to find justification" for discontinuing the prosecution.
This overturned the NPA's original decision to drop almost 800 fraud and corruption charges against the president.
The SCA's decision was not a surprise after counsel for the NPA and Zuma conceded that Mpshe's decision was taken under the wrong section of the Constitution and that - in line with an earlier judgment of the Constitutional Court, this invalidated the decision.
It was also not immediately clear if Zuma would approach the Constitutional Court to try to set aside the Supreme Court's ruling.
Reinstating the charges could undermine the campaign of Nkosazana Dlamini-Zuma, the president's preferred successor for the leadership of the African National Congress in December, and possibly lead to him leaving the national presidency before his term ends in 2019, according to Susan Booysen, a political science professor at the University of the Witwatersrand's School of Governance.
Zuma's prosecution was discontinued by Mpshe - based on the "spy tapes".
The court held that Mpshe's decision was irrational. The opposition Democratic Alliance asked the court to order holding an immediate trial.