South Africa's ruling African National Congress (ANC) has selected Cyril Ramaphosa to succeed President Jacob Zuma as the party's leader.
The country's deputy president defeated former cabinet minister Nkosazana Dlamini-Zuma, Zuma's ex-wife, after a marathon voting process.
Ramaphosa is in a strong position to become president in 2019 polls.
The leadership battle caused fierce political infighting, raising fears the party may split before the election.
Ramaphosa defeated Dlamini-Zuma by 2,440 votes to 2,261, an ANC spokesperson announced.
The result triggered celebrations among party members.
Media reports earlier said the announcement had been delayed after Dlamini-Zuma's camp had demanded a recount.
Ramaphosa, 65, has spoken out strongly against state corruption and has the backing of the business community.
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.