South Africa's Supreme Court of Appeal on Friday upheld a High Court ruling to reinstate hundreds of corruption charges filed against Jacob Zuma before he became president.
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.
Zuma and the National Prosecuting Authority (NPA) were appealing against the High Court ruling, made in April 2016.
In his decision to reject their appeal, Judge Lorimer Leach said it was "irrational" for the NPA to have set the charges aside.
The NPA has responsibility for deciding whether to reinstate the charges, which relate to a 30 billion rand ($2 billion) government arms deal arranged in the late 1990s. It was unclear when such a decision might be taken.
It was also not immediately clear if Zuma would approach the Constitutional Court to try to set aside the Supreme Court's ruling.
The NPA would need to consider the judgement, spokesman Luvuyo Mfaku said, adding it would "at all times do the right thing within the confines of the rule of law and in the interest of proper administration of justice."
The rand extended gains against the dollar after the Supreme Court's ruling, which was unanimous.
"It is difficult to understand why the present regime at the NPA (National Prosecuting Authority) considered that the decision to terminate the prosecution could be defended," Judge Leach said.
The focus of the corruption allegations that Zuma has faced since taking office has been on leaked emails pointing to the Gupta family, business friends of the president, using their influence to secure lucrative state contracts for their companies.
Reuters has not independently verified the emails, and Zuma and the Guptas have consistently denied wrongdoing.