JOHANNESBURG (Reuters) - South Africa’s High Court on Tuesday cleared President Cyril Ramaphosa of lying to parliament about the source of donations to his 2017 campaign to lead the ruling party, setting aside a potentially damaging report by a powerful anti-graft watchdog.

The high court judges described the watchdog’s approach as based on a mistaken and “fatally flawed” reading of the law.

The case was seen by many analysts as a proxy of the bitter power rivalry inside the ANC between supporters of Ramaphosa and his scandal-plagued predecessor Jacob Zuma.

Public Protector Busisiwe Mkhwebane had alleged in July that Ramaphosa deliberately misled parliament about the 500,000 rand ($32,500) donation for his campaign to succeed Jacob Zuma as head of the ruling African National Congress (ANC).

In her report she said there was also prima facie evidence of money laundering involving millions of rand in the handling of the donations, sparking an angry response from Ramaphosa, who swiftly challenged the legality and motivation of the report.

The high court, in a sitting of three justices, concurred with Ramaphosa’s complaint.

“It is apparent from the report that the Public Protector was confused about the legal foundation of her finding,” said Keoagile Elias Matojane.

“The Public Protector’s finding on the issue of misleading parliament is fatally flawed due to a material error of law.”

The court added that there was no evidence to support the allegation of money laundering and that it was also outside of the watchdog’s jurisdiction to investigate the donations as they were of a private, and not public, nature.

The finding against Mkhwebane’s conduct, which includes the award of costs for Ramaphosa’s lawyers, is likely to bolster calls for her removal from office by opposition parties.