The South African government will investigate allegations that the country's top prosecutor was a spy for the apartheid government. The timing of the allegations against the prosecutor are believed to be linked to his corruption investigation of the deputy president.

A government spokesman says the commission of inquiry will be led by a retired judge who has not yet been named. He says details of the inquiry panel will be announced in the next few days.

The cabinet issued a statement saying it wants an independent investigation into the allegations against the Director of Public Prosecutions because they do not want the case tried in the media. It said the country's interests are not served by public witch-hunts.

Many observers see the inquiry as an opportunity for South Africa's chief prosecutor, Bulelani Ngcuka, to clear his name. A local newspaper reported earlier this month that the African National Congress investigated Mr. Ngcuka as a possible spy for the apartheid government in the 1980s, but at the time the party was not able to conclusively decide on his guilt or innocence. The former minister of transport has publicly backed up the newspaper's report.

Mr. Ngcuka has repeatedly declared that he was not a spy, and he says he will sue both the newspaper and the ex-transport minister for defamation. He believes some members of his party, the ANC, are conducting a smear campaign against him because he has refused to shut down his corruption investigation involving Deputy President Jacob Zuma and a controversial arms deal.

Mr. Ngcuka announced last month that he would not prosecute the deputy president for corruption because he did not have enough evidence to convict him. But he said he did have what he called prima facie evidence that there had been some wrongdoing. The deputy president's financial advisor, Shabir Shaik, is being prosecuted in connection with the arms deal.

Answering questions in Parliament, President Thabo Mbeki was forced to defend both the embattled deputy president and the man who led the investigation into his activities.

The president has refused opposition-party demands to fire Mr. Zuma, and he has also expressed confidence in the chief prosecutor.

"In this regard, I would like to state some ground rules in a clear and unequivocal manner," said President Mbeki. "The first of these is that we will not take any disciplinary action or any other action simply on the basis of allegations, whoever makes these allegations."

But the president faced more harsh questions related to both the scandal surrounding the deputy president and the inquiry into the prosecutor.

Opposition lawmaker Joe Seremane of the Democratic Alliance pointed out that the government has decided to open an inquiry into the alleged conduct of the chief prosecutor while, in his view, blocking investigations into the deputy president and the arms deal.

"The accusations against the deputy president have demeaned the stature of the presidency and undermined its moral authority," he said. "And without trivializing the matter, your cabinet has been very quick to investigate the investigators."

A government spokesman says the cabinet wants the investigation into Mr. Ngcuka conducted as a matter of urgency, and he hopes that the inquiry panel will finish its work within a few weeks.

It is a matter the ANC would like to have closed as soon as possible, especially before the next general elections, which are expected to be held in April.