South Africa's President Zuma should face corruption charges over a 1999 arms deal, the High Court has ruled.
The charges were dropped just weeks before the 2009 election which led to Jacob Zuma becoming president.
Ruling on the case brought by the opposition Democratic Alliance, the judge said the decision to drop the charges was "irrational".
The National Prosecuting Authority (NPA) now has to decide if it wants to reinstate the charges.
Mr Zuma always denied the allegations which are linked to the government arms deal worth billions of dollars.
Last week, a judge-led commission of inquiry found no evidence of corruption or fraud by any government officials at the time.
"Today is a great victory for the rule of law and ultimately we believe that Jacob Zuma must face prosecution and this judgement certainly affirms the view that we've always held," Democratic Alliance leader Mmusi Maimane said after the ruling.
"I congratulate my colleagues who've worked exceptionally hard on this case; it's been a long battle."
This may be the latest in a series of legal blows to President Jacob Zuma but it is not yet time to celebrate for the opposition DA, which brought the case.
The NPA will have to decide if it wants to reinstate the charges. As the judge ruled the NPA's prosecution of this case has been heavily politicised — and it is not clear whether it will want to take on the president.
Mr Zuma, 74, may be under increasing pressure from opposition parties to step down but he is not going without a fight. In spite of the knock to his public image, he still has a place in the hearts of many in South Africa. The ruling ANC secured a huge victory in the 2014 election — many of the votes coming from rural South Africa where these court battles have little influence and Mr Zuma knows that.
An opposition attempt to impeach him earlier this month failed because they simply do not have the numbers. The president would take note only if voters rose up against him — local elections later this year will be the real indication of whether any ground has shifted. But until then, he and the ANC see these court battles as attempts by a few to force him from power undemocratically.
It was dubbed the "spy tapes" case after the National Prosecuting Authority (NPA) dropped the charges in 2009.
The authority said new phone-tap evidence suggested political interference in the investigation.
'Mr Zuma should face the charges'
South Africa's governing African National Congress (ANC) said the High Court's ruling did not deal with the merits of any allegations against the president.
"The ANC has consistently supported the legal maxim that justice delayed is justice denied. This matter has dragged on for close to a decade and the ANC is pleased therefore that it now appears closer to resolution, seven years since the NPA decision," it said in a statement.
What are the spy tapes?
In 2009, NPA chief prosecutor Mokotedi Mpshe received phone-tap evidence from Mr Zuma's lawyers
He said the recordings suggested political interference in the investigation
The recordings were of conversations that Leonard McCarthy, a former head of an elite unit fighting organised crime, had with several people about the timing of the case against Mr Zuma
In 2014, the opposition DA won a court battle to access the sealed recordings and make them public
After listening to the recordings, the DA legal team believed there was nothing that warranted the charges being dropped
A High Court ruling in April 2016 says the 2009 decision was irrational and Mr Zuma should face charges.
Judge Aubrey Ledwaba said Mr Mpshe had "found himself under pressure" when he decided to discontinue the prosecution and "consequently made an irrational decision".
"Considering the situation in which he found himself, Mr Mpshe ignored the importance of the oath of office which commanded him to act independently and without fear and favour.
"It is thus our view that the envisaged prosecution against Mr Zuma was not tainted by the allegations against Mr McCarthy.
"Mr Zuma should face the charges as outlined in the indictment."
This is the latest legal setback for the South African president.
Last month, South Africa's highest court found that he had breached the constitution by failing to repay public money used to upgrade his private home.
It backed an earlier ruling by an anti-corruption body that said $23m (£15m) of public money had been improperly spent on Mr Zuma's rural home in Nkandla in KwaZulu-Natal province.
Controversial arms deal: What you need to know
1999: largest-ever post-apartheid arms deal announced with contracts totalling 30bn rand ($5bn; £2.5bn) to modernise national defence force
Deal involved companies from Germany, Italy, Sweden, the UK, France and South Africa
Allegations of bribery over deal dogged governments of President Jacob Zuma and predecessor Thabo Mbeki
Mr Zuma's former financial adviser Schabir Shaik convicted in 2005 for corruption over deal. Found guilty of trying to solicit bribe from Thint, local subsidiary of French arms firm Thales, on behalf of Mr Zuma — then deputy president. Released on parole on health grounds after serving just over two years
Another official, Tony Yengeni, chairman of parliament's defence committee at time of deal and ANC chief whip, convicted of fraud in 2003. Also freed on parole after serving five months of four-year sentence
April 2016: commission of inquiry into deal found no further evidence of corruption or fraud.