South Africa’s ruling African National Congress (ANC) has selected Cyril Ramaphosa to succeed President Jacob Zuma as the party’s leader.
The nation’s deputy president defeated former cabinet minister Nkosazana Dlamini-Zuma, Mr Zuma’s ex-wife, after a marathon voting process.
Mr Ramaphosa is in a strong position to become president after polls in 2019.
The leadership battle caused fierce political infighting, raising fears the party may split before the polls.
Mr Ramaphosa beat Ms Dlamini-Zuma by 2440 votes to 2261, an ANC spokesperson announced.
This triggered celebrations among party members.
Media reports earlier said the announcement was delayed after Ms Dlamini-Zuma’s camp had demanded a recount.
The voting process started on Sunday.
What were the differences between the two candidates?
Mr Ramaphosa, 65, has spoken out strongly against state corruption and has the backing of the business community.
He campaigned as the anti-Zuma candidate, promising to target corruption, and his victory could mean that the ANC decides to recall Mr Zuma as national president in the next few weeks.
The ANC recalled Mr Zuma’s predecessor, Thabo Mbeki, in 2008 after Mr Zuma replaced him as ANC leader the previous year.
Ms Dlamini-Zuma, 68, had been critical of the enduring power of white-owned businesses and had pledged to tackle what she said was continued racial inequality.
Analysts said that Mr Zuma had backed his former wife.