Cyril Ramaphosa has been elected the new leader of the ruling African National Congress (ANC), defeating Nkosazana Dlamini-Zuma, after a series of tense sessions at the party's conference.
The ANC announced on Monday that Ramaphosa had defeated President Jacob Zuma’s preferred candidate Dlamini-Zuma, the former chairperson of the African Union Commission, to become the leader of Africa's oldest liberation movement.
Ramaphosa won 2 446 votes, to Dlamini-Zuma's 2 261.
Ramaphosa will replace President Jacob Zuma as ANC president and almost certainly run as presidential candidate when South Africa takes to the polls in 2019.
Zuma will remain as president but it is possible that Ramaphosa and the new national executive may recall him over a series of allegations of graft that has dogged his tenure as president.
It was an election that threatened to split the party. The two leading candidates presented completely different visions for future of the country.
More than 4,700 delegates cast their ballot in a marathon voting session that began late on Sunday night and continued until mid-morning on Monday.
Voting had been initially delayed after ANC officials battled to vet delegates, forcing the conference itself to start late. Hundreds of delegates were also disqualified from voting.
Earlier on Monday, Zuma told reporters that he was bowing out happily.
"I’m bowing out very happy because I think ... I made my contribution. So I am very happy."
In his final address as ANC president on Saturday, Zuma appeared to endorse Dlamini-Zuma when he said that it was a milestone that there were three female candidates for president.
He also blamed ill-discipline among party cadres and factionalism for the failures of the party. He made no mention of the ways in which he had brought the party into disrepute over several allegations of corruption.