Jacob Zuma said he was the victim of a conspiracy by enemies who had tried to get rid of him (FILE PHOTO)

Former South African president Jacob Zuma told a corruption inquiry on Monday that he had never broken the law with the Gupta family, describing the businessmen at the centre of an influence-peddling scandal as friends.

Zuma also said he was the victim of a conspiracy by enemies who had tried to get rid of him for more than 20 years.

His appearance at the inquiry - set up to test allegations that Zuma allowed cronies to plunder state resources and influence government appointments - marked a dramatic fall from grace for a politician who long dominated the country's politics.

Referring to the three Gupta brothers, Zuma said, "I never did anything with them unlawfully, they just remained friends. ... Never, never did I discuss any matter that does not belong to them".

"They were businesspeople and successful businesspeople," Zuma continued. "I'm not a businessperson, I know nothing about business, I'm a politician, I know something about politics."

Zuma, ousted by the governing African National Congress (ANC) in February 2018 and replaced by President Cyril Ramaphosa, has consistently denied wrongdoing over his nine years in power.

Under pressure from rivals in the ANC, Zuma set up the corruption inquiry he now sits before in his final weeks as president, as a number of his colleagues, including Ramaphosa, feared scandals surrounding Zuma could indelibly tarnish the party's reputation.

Zuma had avoided establishing the inquiry since a 2016 report by South Africa's anti-corruption watchdog, the public protector, instructed him to do so to investigate allegations that three Gupta brothers had been able to influence ministerial appointments and had won state contracts improperly.

The Gupta family denied the accusations and left South Africa around the time that Zuma was ousted.