CAPE TOWN — South Africa on Monday took an important step toward restoring a more independent justice system, removing a chief prosecutor widely seen as an obstacle to reining in the country’s rampant corruption.
The prosecutor, Shaun Abrahams, the director of public prosecutions, was ordered to step down immediately by the country’s highest court, a decision that left room for South Africa’s president, Cyril Ramaphosa, to take a tougher stance on the endemic graft within his party, the African National Congress.
When he took office in February, Mr. Ramaphosa pledged to usher in a new era of clean government, which he would accomplish in part by clearing out officials tied to the abuses of his predecessor as president, Jacob Zuma.
With the power to name a new chief prosecutor, Mr. Ramaphosa can now put his stamp on the office that effectively determines “who or what gets prosecuted” in South Africa, said Sithembile Mbete, who teaches politics at the University of Pretoria.
Monday’s judgment provides the Ramaphosa administration with an opportunity to address “root issues of political interference” in prosecutorial decisions, Ms. Mbete added.
As head of the National Prosecuting Authority, or N.P.A., Mr. Abrahams gained a reputation for loyally defending Mr. Zuma’s interests, earning him the nickname of Shaun the Sheep in the local news media.
Among his more notable and criticized decisions was declining to charge officials linked to allegations of state capture by the Guptas, an Indian business family with close ties to Mr. Zuma.
State capture is a type of corruption in which a small number of private businesses shape government policy to their own advantage.
Working through friends and family of Mr. Zuma, including one of his sons, Duduzane, 34, the Guptas won lucrative state contracts in industries as varied as mining and agriculture, siphoning millions of dollars from the public purse and influencing ministerial appointments. Another controversial decision by Mr. Abrahams was his refusal to charge Duduzane Zuma with culpable homicide after he crashed his Porsche into a minibus taxi in 2014, killing two people.
The charges were reinstated this year, after Mr. Ramaphosa took office.
In a majority ruling, the Constitutional Court on Monday found that the 2015 appointment of Mr. Abrahams was invalid and had come about through an “abuse of power” by Mr. Zuma.
Mr. Zuma had offered Mr. Abrahams’ predecessor, Mxolisi Nxasana, a payout of more than $1 million to resign, clearing the way for an appointment of a prosecutor more favorable to his interests.
Analysts hoped the dismissal of Mr. Abrahams would help restore the independence of a justice system drawn into factional battles within the governing party, the A.N.C., and hamstrung by high-level corruption.
“This judgment is critical for addressing state capture,” said Ben Theron, chief operations officer at the Organization Undoing Tax Abuse, a local corruption watchdog. “We hope that era of capturing N.P.A. and manipulation has been brought to a stop.”
While Mr. Ramaphosa has made fighting corruption a priority of his administration, he also relies on political support from top party officials implicated in multiple corruption scandals, raising questions about his ability to enact meaningful change.
“There will be people within the A.N.C., and their backers, who won’t want an effective and independent prosecutions director because they won’t be able to interfere with cases politically,” Ms. Mbete said.
The A.N.C. welcomed the court’s decision in a statement, calling for “speed and urgency” in appointing a new head prosecutor. Mr. Ramaphosa has 90 days to name a replacement.
“What is critical for the A.N.C. is the restoration of the independence, integrity and credibility of this key law enforcement agency,” said a party spokesman, Pule Mabe. “Anything that compromises the independence of the N.P.A. will undermine its credibility and lead to a serious erosion of the rule of law.”
A spokesman for the prosecuting authority, Luvuyo Mfaku, said that Mr. Abrahams was “gravely disappointed” but would respect the judgment, which instructed him to vacate his office immediately.