After weeks of tortuous discussions, Cyril Ramaphosa has fulfilled his long-held ambition to lead South Africa.
A shrewd negotiator who has been Jacob Zuma's deputy since 2014, Ramaphosa has been the country's dominant politician since he replaced his boss as leader of the ruling African National Congress (ANC) in December.
But he had to strike a fine balance between applying pressure on Zuma, a 75-year-old anti-apartheid veteran, and affording him a dignified exit.
Facing waning electoral support for his party, Ramaphosa needed to avoid alienating ANC members still loyal to Zuma despite the economic stagnation and sleaze allegations that tainted his nine years in power.
Ramaphosa, 65, used the same painstaking negotiating strategy he employed in talks to end white minority rule, when he negotiated on behalf of the ANC. He ignored frustration from some sections of the media and opposition parties who have been howling for Zuma to go for years.
Ramaphosa's deal-making skills have been apparent for decades.
Nelson Mandela turned to the former trade union leader when he needed a tenacious negotiator to lead talks to end apartheid. The successful conclusion of those talks paved the way for Mandela to sweep to power in 1994 as head of the victorious ANC after South Africa's first democratic vote.
There were reports that Mandela wanted Ramaphosa to be his heir but was pressured into picking Thabo Mbeki by a group of ANC leaders who had fought apartheid from exile.
It has taken more than two decades for Ramaphosa to get another chance to run the country.
"Ramaphosa's ambition for the presidency has been clear through his whole adult life. He was quite clearly wounded by his marginalisation in the Mbeki period," said Anthony Butler, a politics professor who has written a biography of Ramaphosa.
Unlike Zuma, Ramaphosa was not driven into exile for opposing apartheid, which some of the party's more hardline members hold against him.
He fought the injustices of white minority rule from within South Africa, most prominently by defending the rights of black miners as leader of the National Union of Mine workers.
A member of the relatively small Venda ethnic group, Ramaphosa was able to overcome divisions that sometimes constrain members of the larger Zulu and Xhosa groups.
The importance of Ramaphosa's contribution to the talks to end apartheid is such that commentators have referred to them in two distinct stages: BC and AC; Before Cyril and After Cyril.
Ramaphosa also played an important role in drafting South Africa's post-apartheid constitution.
After missing out on becoming Mandela's deputy, Ramaphosa withdrew from active political life, switching to business.
His investment vehicle Shanduka - Venda for "change" - grew rapidly and acquired stakes in mining firms, mobile phone operator MTN and McDonald's South African franchise.
Phuti Mahanyele, a former chief executive at Shanduka, recalled that Ramaphosa required staff to contribute to charitable projects aimed at improving access to education for the under-privileged.
By the time Ramaphosa sold out of Shanduka in 2014, the firm was worth more than 8 billion rand (Sh960 million), making him one of South Africa's 20 richest people.
To his supporters, Ramaphosa's business success equips him for the task of turning around an economy grappling with 28 per cent unemployment and credit rating downgrades.
South Africa's former finance minister, Pravin Gordhan expressed confidence that Ramaphosa's election as ANC leader was enough to bring economic change within three months.
But Ramaphosa has his detractors too. He was a non-executive director at Lonmin when negotiations to halt a violent wildcat strike at its Marikana platinum mine in 2012 ended in police shooting 34 strikers dead.
An inquiry subsequently absolved Ramaphosa of guilt. But some families of the victims still blame him.
Others have warned Ramaphosa that he should not take their support for granted.
"Cyril has got to be wiser than President Zuma," said Sdumo Dlamini, president of the South African trade union federation.