JOHANNESBURG : South African deputy president Cyril Ramaphosa was elected head of the ruling ANC party Monday, winning a bruising race that exposed deep rifts within the organisation that led the struggle against apartheid.

"We declare comrade Cyril Ramaphosa the new president of the African National Congress," an election official told party delegates in Johannesburg.

The victory puts Ramaphosa in line to succeed President Jacob Zuma, whose reign has been plagued by corruption scandals, economic slowdown and growing anger at the once-omnipotent party.

Thousands of raucous Ramaphosa supporters sang and chanted in the conference hall as rival backers of defeated candidate Nkosazana Dlamini-Zuma appeared dejected. Ramaphosa won 2,440 votes to Dlamini-Zuma's 2,261.

The vote was a long and acrimonious process. Delegates from around South Africa cast their ballots after repeated delays caused by disputes over who was entitled to vote.

Hundreds of attendees were banned from the poll, raising the possibility that supporters of Dlamini-Zuma, a former minister who is Zuma's ex-wife, could launch legal appeals against the result.

"I hope you will cooperate with the new leadership... as we move to the 2019 elections" Baleka Mbete, party chairwoman, told delegates.