South Africa’s High Court has ruled that Jacob Zuma’s appointment of a state prosecutor to decide whether to reinstate corruption charges against him was not valid.

The court also ruled that President Zuma should not make a new appointment. It said deputy president Cyril Ramaphosa should appoint a new public prosecutor within 60 days.

The ruling is a stinging rebuke for Mr Zuma, who is due to step down in 2019 after more than a decade in power. The President’s office said he would appeal the decision.

The National Prosecuting Authority (NPA), whose head prosecutor Shaun Abrahams was removed from his post by the High Court ruling, was not available to comment.

The rand was buoyed by the court ruling, with analysts saying markets saw Mr Zuma’s influence curtailed.

Judge president Dunstan Mlambo said at the Pretoria High Court the appointment of Mr Abrahams as the national director of public prosecutions was “invalid and set aside”.

In his ruling, judge Mlambo said: “In our view, President Zuma would be clearly conflicted in having to appoint a national director of public prosecutions, given the background ... and particularly the ever present spectre of the many criminal charges against him that have not gone away.”

The charges against Mr Zuma relate to a 30 billion rand (£1.5bn) government arms deal arranged in the late 1990s and have amplified calls for Mr Zuma to step down before his term as President ends in 2019.

In October the Supreme Court of Appeal upheld an earlier decision by a lower court that the nearly 800 corruption charges filed against Mr Zuma before he became President be reinstated.

It then fell to Mr Abrahams, appointed by Mr Zuma as chief state prosecutor in 2015, to decide whether or not the NPA would pursue a case against Mr Zuma.

Mr Abrahams gave Mr Zuma until the end of November to make representations to prevent the charges being brought against him. Mr Abrahams has not commented on whether Mr Zuma presented any submissions of what decision he has taken on the matter.

The case in the Pretoria High Court had been brought by a trio of civil society organisations seeking an order declaring the previous state prosecutor’s removal was invalid.

The African National Congress (ANC), which is set elect Mr Zuma’s successor next week, said it would allow the parties involved to reflect on the judgment and its implications as well as decide whether to appeal or not.

Calls for Zuma resignation in Pretoria Show all 14 1 /14 Calls for Zuma resignation in Pretoria Calls for Zuma resignation in Pretoria Calls for Zuma resignation in Pretoria Riot police guard the entrance to a courthouse in Pretoria AP Calls for Zuma resignation in Pretoria Calls for Zuma resignation in Pretoria A protester holds a butternut squash painted with an image of South African President Jacob Zuma AP Calls for Zuma resignation in Pretoria Calls for Zuma resignation in Pretoria South African opposition party Economic Freedom Fighters' (EFF) supporters shout as they demonstrate for the release of a report into corruption allegations against South African president on front of the High Court in, Pretoria AFP/Getty Calls for Zuma resignation in Pretoria Calls for Zuma resignation in Pretoria Riot police guard the entrance to a courthouse in Pretoria AP Calls for Zuma resignation in Pretoria Calls for Zuma resignation in Pretoria An Economic Freedom Fighters (EFF) member burning tyres in Pretoria city centre, South Africa EPA Calls for Zuma resignation in Pretoria Calls for Zuma resignation in Pretoria Protestors looting a shop at a BP garage in Pretoria city centre, South Africa Reuters Calls for Zuma resignation in Pretoria Calls for Zuma resignation in Pretoria A protestor runs for cover as police officers fire stun grenades during a march to call for the removal of President Jacob Zuma Reuters Calls for Zuma resignation in Pretoria Calls for Zuma resignation in Pretoria Police officers stand guard during a march by the members of the Economic Freedom Fighters (EFF) Reuters Calls for Zuma resignation in Pretoria Calls for Zuma resignation in Pretoria A member of the Economic Freedom Fighters (EFF) carries a tire around his neck as they call for the removal of President Jacob Zuma outside the Union buildings in Pretoria Reuters Calls for Zuma resignation in Pretoria Calls for Zuma resignation in Pretoria Members of the Economic Freedom Fighters (EFF) hanging on the tree during an anti-government march outside the Union Building in Pretoria AP Calls for Zuma resignation in Pretoria Calls for Zuma resignation in Pretoria Members of the Economic Freedom Fighters (EFF) march during an anti-government protest outside the Union Building in Pretoria AP Calls for Zuma resignation in Pretoria Calls for Zuma resignation in Pretoria A metro police officer, runs past a burning barricade during an anti-government march in Pretoria AP Calls for Zuma resignation in Pretoria Calls for Zuma resignation in Pretoria A man carries a sledgehammer as South African opposition Economic Freedom Fighters (EFF) party members and supporters demonstrate in Pretoria AFP/Getty Calls for Zuma resignation in Pretoria Calls for Zuma resignation in Pretoria Economic Freedom Fighters supporters gather by a burning garbage bin as they march in downtown Pretoria AP

Ralph Mathekga, an independent analyst, said the court’s decision “will most likely be appealed if you look at government’s track record. It will surely end up in the Constitutional Court”.

“It will spilt the ANC even further. In a way it does empower Ramaphosa. But remember, there is faction in the ANC that is very suspicious of the courts and this could embolden Zuma and his allies’ anti-establishment campaign.”