South African President Nelson Mandela on Friday completed an unprecedented and grueling court appearance, sticking to his guns that an inquiry into the white-dominated sport of rugby was necessary.

Mandela, the first South African head of state to take the stand to justify an executive decision, said there was a cloud over rugby that only an inquiry could clear."Nothing short of an independent inquiry can clear the allegations and perceptions, and that is why it is necessary to have this commission," Mandela said.

The South African Rugby Football Union is challenging Mandela's decision to appoint a judicial commission to probe allegations of racism and mismanagement in the sport.

SARFU president Louis Luyt has alleged in documents that the decision was grossly unreasonable or that Mandela rubber-stamped a request by Sports Minister Steve Tshwete without personally considering the need for the inquiry.

After his appearance in the Pretoria High Court, Mandela said he still had misgivings about being subpoenaed to appear in court.

"I have grave reservations about the order (subpoena), but we have to obey the constitution because it does not give immunity to a president or anybody else," he told reporters.

On Thursday, Mandela clashed with SARFU lawyer Mike Maritz, accusing him of trying to portray the president as a liar.

On Friday Mandela charged: "Mr. Maritz is an expert in distorting what was said. He is twisting me . . . ."

However, Mandela's avuncular side was also in evidence as he warmly greeted SAFRU's legal team and spent some time with Luyt in seemingly light-hearted conversation in the courtroom.

He admitted after his appearance that he had expected to be grilled, but the lawyers had made his testimony more comfortable.

"They make it easy, even though the cross-examination is gruelling," said Mandela, who stood throughout his six-hour testimony.

One senior government official present in court to support Mandela said the court proceedings were an outrage. "The president should not be here. He should not have to go through this."

A legal expert said Mandela's lawyers had done all they could to keep Mandela from testifying and there was no international precedent of a president taking the stand.

The expert blamed the judge for dragging Mandela into court over a relatively trivial matter.

Another expert said he believed SARFU may have miscalculated the long-term effect of summoning Mandela to court.