Cyrial Ramaphosa was elected South African president on Thursday, a day after the resignation of Jacob Zuma. (The Associated Press)

Cyril Ramaphosa has been elected as South Africa's president just hours after the country's scandal-plagued leader Jacob Zuma resigned on Wednesday.

Deputy president since 2014, Ramaphosa has been the country's dominant politician since he replaced Zuma as leader of the ruling African National Congress in December.

South African President Jacob Zuma resigns

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.

On Wednesday, Zuma heeded the orders of the ANC to end to his nine years in power. The ANC replaced Zuma as party leader in December with then Deputy President Ramaphosa, ordered him to step down on Tuesday.

When Zuma failed to resign, it announced it would back an opposition motion in parliament to force him out.

Ramaphosa, 65, has put the focus on rooting out corruption and revitalizing economic growth.

Dealmaker for decades

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.

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.

In a 30-minute farewell address to the nation Wednesday, 75-year-old Zuma said he disagreed with the way the ANC had shoved him towards an early exit after the election of Cyril Ramaphosa as party president in December, but would accept its orders. (Rogan Ward/Reuters)

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 throughout his adult life. He was quite clearly wounded by his marginalization in the Mbeki period," said Anthony Butler, a politics professor who has written a biography of Ramaphosa.

Major challenges ahead

Ramaphosa faces a major challenge in turning the country round. But his pledges to boost growth and fight corruption have gone down well with foreign investors and ANC members who thought Zuma's handling of the economy could cost the party dearly in a parliamentary election next year.Financial markets have seen a "Ramaphosa rally" since he defeated Zuma's preferred successor and ex-wife Nkosazana Dlamini-Zuma in last year's ANC leadership contest.

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 Mineworkers.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.A massive strike by miners led by Ramaphosa's NUM in 1987 taught business that "Cyril was a force to be reckoned with," said Michael Spicer, a former executive at Anglo American.

"He has a shrewd understanding of men and power, and knows how to get what he wa nts from a situation," Spicer said.

Helped draft constitution

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 underprivileged.By the time Ramaphosa sold out of Shanduka in 2014, he was one of South Africa's 20 riche st people.

'Cyril has got to be wiser'

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.

Pravin Gordhan, a former finance minister, told Reuters that Ramaphosa's election as ANC leader was enough to change "the whole narrative about South Africa's economy" within three months.But Ramaphosa has his detractors.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 fatally shooting 34 workers on strike.An inquiry subsequently absolved Ramaphosa of guilt. But some families still blame him for urging the authorities to intervene."My conscience is that I participated in trying to stop further deaths from happening," Ramaphosa said of the incident.Others have warned Ramaphosa that he s hould not take their support for granted."Cyril has got to be wiser than President Zuma," said Sdumo Dlamini, president of South African trade union federation and a member of the ANC's national executive.

"He leads as part of a collective, and we need to see a serious turnaround to address the challenges of joblessness and inequality, which are huge."