CAPE TOWN — South Africans witnessed the extraordinary spectacle this week of having both the president and his predecessor publicly called to account on accusations of corruption — charges that are also escalating a power struggle within the long-governing African National Congress.

The leader of the country’s anticorruption agency said on Friday that the current president, Cyril Ramaphosa, had “deliberately misled” Parliament about the nature of a $36,000 donation to his campaign in 2017 from a logistics company at the center of a major corruption scandal.

The anticorruption agency leader, Busisiwe Mkhwebane, also said that Mr. Ramaphosa had violated the A.N.C. ethics code, which gave him 30 days to disclose his campaign funding in full. The president’s office answered on Friday that the accusation was “deficient both factually and in law,” and said that a formal response provided by Mr. Ramaphosa’s lawyers had not been given sufficient consideration.

The accusation against Mr. Ramaphosa came at the end of a week in which Jacob Zuma, his predecessor as president, was called to testify before a high-level inquiry into government corruption. On Friday, Mr. Zuma briefly withdrew from testifying, in a standoff that has reflected deep divisions within the A.N.C.