* Mandela wanted Ramaphosa as heir, but Mbeki chosen
* Ramaphosa has vowed to tackle corruption, fix economy
* Rand surge points to approval of investors
By Alexander Winning
JOHANNESBURG, Dec 18 (Reuters) - The nearly man of South African politics, deputy president Cyril Ramaphosa, took a big step towards the top job on Monday when he was elected by a whisker as head of the ruling African National Congress (ANC).
Ramaphosa's ability has been apparent for decades. Whenever Nelson Mandela needed a breakthrough in talks to end apartheid, he turned to the then-trade union leader with a reputation as a tenacious negotiator.
Using skills honed in pay disputes with mining bosses, Ramaphosa steered those talks to a successful conclusion, allowing 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.
It has taken more than two decades for Ramaphosa to get another chance to run the country.
Monday's party vote, which handed him victory by less than 200 of nearly 5,000 ballots, puts that goal firmly within the 65-year-old's grasp. The rand surged as much as 4 percent, suggesting approval of the business community.
"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.
The choice of Ramaphosa over his main rival for the ANC's top job, former cabinet minister Nkosazana Dlamini-Zuma, is likely to chart a reformist course for South Africa, which has lost its lustre under President Jacob Zuma.
A lawyer with an easygoing manner, Ramaphosa has vowed to fight corruption and revitalise an economy that has slowed to a near-standstill under Zuma's scandal-plagued leadership.
His message went down well with foreign investors and ANC members who thought Zuma's handling of the economy could cost the party dearly in 2019 parliamentary elections.
Dlamini-Zuma promised a radical brand of wealth redistribution popular with poorer ANC voters who are angry at racial inequality.
While Ramaphosa has backed calls for "radical economic transformation", an ANC plan to tackle inequality, he tends to couch his policy pronouncements in more cautious terms.
Unlike Zuma or Dlamini-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 (NUM).
A member of the relatively small Venda ethnic group, Ramaphosa was able to overcome divisions that sometimes constrained members of the larger Zulu and Xhosa groups.
A massive miners' strike 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 wants from a situation," Spicer said.
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 the drafting of South Africa's post-apartheid constitution.
After missing out on becoming Mandela's deputy, Ramaphosa withdrew from active political life, switching focus to business.
His investment vehicle Shanduka - Venda for "change" - grew rapidly and acquired stakes in mining firms, mobile operator MTN and McDonald's South African franchise.
Phuti Mahanyele, a former chief executive at Shanduka, recalled that Ramaphosa was a passionate leader who 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, the firm was worth more than 8 billion rand ($584 million in today's money), making Ramaphosa one of South Africa's 20 richest people.
To his supporters, Ramaphosa's business success makes him well-suited to the task of turning around an economy grappling with 28 percent unemployment and credit rating downgrades.
In the Johannesburg township of Soweto last month, Ramaphosa called for a "new deal" between business and government to spur economic growth.
Pravin Gordhan, a respected former finance minister, told Reuters that if Ramaphosa was elected ANC leader, "the whole narrative about South Africa's economy would change for the better 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 for urging the authorities to intervene.
"My conscience is that I participated in trying to stop further deaths from happening," Ramaphosa said about the deaths.
Others are unconvinced that Ramaphosa, who has been deputy president since 2014, will be as tough on corruption as his campaign rhetoric suggests.
Bantu Holomisa, an opposition politician and former ANC member who worked closely with him in the 1990s, said he was by nature cautious.
"Cyril has been part of the machinery and has not acted on corruption so far," Holomisa said. "It is not clear whether he will if he gets elected." ($1 = 13.6947 rand)
Editing by James Macharia, Ed Cropley and Matthew Mpoke Bigg