JOHANNESBURG (Reuters) - South Africa’s ruling African National Congress (ANC) needs to put an end to scandals that are tarnishing its image, an ANC official said, after a court ruling that paved the way for President Jacob Zuma to face nearly 800 counts of corruption.

Zweli Mkhize, one of the ANC’s “top six” leaders, also called for an end to factionalism within the party at a public lecture late on Friday, saying it was playing into the hands of the opposition.

Mkhize is in the running to replace Zuma as ANC leader at the party’s elective conference in December, and his campaign has been gathering momentum in recent weeks.

The battle between the two frontrunners for ANC leader - Deputy President Cyril Ramaphosa and Nkosazana Dlamini Zuma, an ex-wife of Zuma and former chairwoman of the African Union - has bitterly divided the party that has governed South Africa since the end of white minority rule in 1994.

Affable and a long-serving cadre, Mkhize is touted as a compromise candidate who could soothe tensions between the party’s primary factions. He is also well-liked by investors unnerved by the party’s swing toward populist policies.

“We see fractions and divisions in the regions, at the national level. And you’ve got court cases all over,” Mkhize told ANC supporters packed into a hall in the Kagiso township to the west of Johannesburg.

“We need to say to each other enough is enough. ... The image of the African National Congress rests on the behaviour of its own leaders,” Mkhize said.

Earlier on Friday, South Africa’s Supreme Court of Appeal upheld a High Court ruling reinstating 783 corruption charges against Zuma from before he became president.

Zuma, who has denied numerous other corruption allegations since taking office, has asked prosecutors to “consider representations” before deciding whether to proceed against him.

Mkhize avoided mentioning Zuma by name in his speech in Kagiso. He hails from Zuma’s home province of Kwa-Zulu Natal and was formerly a staunch Zuma supporter.

Asked whether Zuma should step down as president after a new ANC leader is elected in December, Mkhize said that would be up to the party to decide.

Zuma’s term as president ends in 2019, when South Africa next holds a general election, but his predecessor Thabo Mbeki was ousted before the end of his term in 2008 after losing out in a power struggle with Zuma.

“We believe the ANC is strong enough to survive all of this, and we want to be able to show that the ANC is serious about acting on corruption,” Mkhize said.