In a blow to his administration, President Jacob Zuma has been ordered to set up the inquiry recommended in the "State of Capture" report within 30 days. The court called Zuma's challenge an abuse of judicial process.
The 75-year old President Zuma has faced corruption allegations since taking office in 2009.
This latest encounter with the courts came as a result of the president's legal challenge over the right of the public protector to call for a judicial inquiry and the appointment by the chief justice of a judge to head it. Zuma argued it was the president's prerogative whether such an inquiry should be set up.
But in a ruling issued on Wednesday in Pretoria, High Court Judge President Dunstan Mlambo upheld a recommendation by South Africa's public protector and said Zuma's conduct was "clearly objectionable ... and amounts to clear abuse of the judicial process."
"The president is directed to appoint a commission of inquiry within 30 days, headed by a judge solely selected by the chief justice," it said.
Mlambo said a judicial commission was best suited to investigate the allegations against Zuma: "The allegations ... detailed in the report are extremely serious," he said.
Once the inquiry has been set up, it should present its report to Zuma within 180 days, the court ordered. The president would then have to inform parliament within 14 days of the action he planned to take, based on the inquiry's findings.
Zuma was ordered to pay the costs of his latest court challenge.
Report lists graft allegations against Zuma
The inquiry was recommended in a report called "State of Capture" released last year by the public protector. Zuma had tried to block the release of the report which looked at allegations that Zuma's associates, including the Gupta brothers had influenced the appointment of ministers. Ajay, Atul and Rajesh Gupta and Zuma denied wrongdoing.
Thuli Madonsela, the report's author, was at the court and said: "An allegation that the state has been captured in the interests of the president and his friends is an allegation that needs to be investigated immediately."
The ruling African National Congress (ANC) issued a statement saying the inquiry was crucial in verifying the allegations in the 355-page report. "We therefore trust President Jacob Zuma will implement this judgment without delay in the interest of our country," it said.
Just days before, the same court ruled that Zuma's appointment of a state prosecutor to decide whether to reinstate corruption charges was not valid and should be immediately set aside.
jm/se (Reuters, dpa)