"I felt betrayed because a matter that was given in confidence was leaked," Phosa, the ANC’s former treasurer, told the High Court in Pretoria on Thursday.

He was testifying in his defence, in a R10m defamation lawsuit which Mabuza brought against him. Mabuza is also the premier of Mpumalanga.

The case relates to a top secret report Phosa handed to ANC officials in 2014. According to the document, Mabuza was an apartheid government informer, agent PN485, who spied on party leaders, including Phosa, during South Africa's liberation struggle. Mabuza has denied the allegations.

Phosa told the court that everything started when ANC deputy secretary general Jessie Duarte asked him who Mabuza was.

He said he gave Duarte the history of how Mabuza was recruited to join the party during apartheid. Following that engagement, he came across a letter claiming Mabuza was a spy who provided the apartheid government with information that led to the killing of Portia Shabangu in 1989.

"I got home one day and the cook handed me a white envelope. Inside was what has now become known as the spy report. I read the document and I was shocked."

He said the allegations were so serious, he had felt compelled to give the letter to the highest office in the ANC.

"If proved true, it would impact on the integrity of the ANC, and particularly the leadership of Mpumalanga province and the premier."

Phosa contacted Duarte and asked for a secure e-mail address to which he could send the document. He said he thought party leaders would institute an investigation. That did not happen.

Phosa then got a call from a journalist, asking him for comment because Mabuza would be suing him for defamation. He then approached Duarte to find out how the document had leaked.

She told him she had made copies at the advice of the ANC president and senior officials.

"She said she did not know how it had leaked between them," said Phosa.

He rejected allegations that he had disseminated the report and said it was Mabuza who kept publishing it and giving information during press briefings.

Mabuza was in court, while his supporters sang and danced outside the building.