The rand strengthened on Friday after a court ruled that President Jacob Zuma’s appointment of a state prosecutor to decide whether to reinstate corruption charges against him was not valid, while shares in Steinhoff plunged further.

At 1546 GMT, the rand was up 0.66% to 13.64 against the dollar and was on course for gains of around 0.75% against the dollar this week.

The rand has tended to rally on events which weaken Zuma’s position as president. Zuma’s second term ends in 2019 and his rule has been marred by corruption scandals and economic mismanagement.

Under the state prosecutor whose appointment was set aside on Friday by South Africa’s High Court, there has been little progress with the nearly 800 corruption charges filed against Zuma before he became president.

The court also ruled that Zuma should not be the one to appoint a new prosecutor. The presidency said Zuma would appeal the ruling.

Shaun Murison, a senior analyst at IG Group, said the court ruling was not the only factor supporting the rand.

“Pre-court ruling we saw the rand clawing back some of its overnight losses against the greenback,” he said. “The rand has been trending firmer since we averted the Moody’s ratings downgrade.”

Last month Moody’s placed South Africa on review for a downgrade, while S&P Global cut the country’s local-currency debt to sub-investment grade.

On the stock exchange, the benchmark Top 40 Index inched up 0.03% on Friday to 51 671 points, while the broader All Share Index was unchanged at 58 012 points.

Shares in household goods retailer Steinhoff plummeted 40% to R6 as more investors dumped the stock after it disclosed an investigation into accounting irregularities earlier this week.

Steinhoff shares have lost 90% of their value this week as the company’s chief executive quit and it postponed the publication of its annual results.

E-commerce firm Naspers, which owns a third of China’s TenCent Holdings, was the biggest gainer among blue-chips advancing 2.5% to R3 619.20.

Next week, market attention will switch to data including consumer inflation and current account data, as well as the race to take over as leader of the ruling African National Congress (ANC) party.

The ANC’s leadership conference kicks off next weekend, when party members will likely choose between Deputy President Cyril Ramaphosa and former cabinet minister Nkosazana Dlamini-Zuma.

Markets have tended to see Ramaphosa as more business-friendly, and signs he has been doing well in nominations for ANC leader have supported South African assets in recent weeks.

On Friday, the yield on South Africa’s benchmark 2026 bond was unchanged.