JOHANNESBURG (Reuters) - South African President Cyril Ramaphosa, who has staked his reputation on cleaning up the image of the ruling African National Congress, will lead the party toward its biggest test of the democratic era when South Africans vote on Wednesday.

Ramaphosa, who helped found the country's biggest mining union and later became one of its wealthiest businessmen, took on the presidency in 2018 and survived a misconduct scandal to be re-elected to the ANC's helm in 2022.

He has struggled to lift economic growth, make a dent in high unemployment with a third of South Africans jobless, or end crippling power cuts - all of which voters are expected to punish the ANC for at the ballot box on May 29.

If the party loses its majority for the first time in 30 years, as opinion polls predict, some political analysts say 71-year-old Ramaphosa will be unlikely to see out a second term.

Ramaphosa was the ANC's lead negotiator during talks that led to a peaceful end to apartheid, which enabled Nelson Mandela to become South Africa's first Black president after 1994's historic all-race vote.

He also played an important role in the drafting of South Africa's progressive constitution.

Despite his evident gifts, Ramaphosa gave up politics in 1996 and entered business, as Mandela's newly elected ANC sought to dilute the dominance of the white minority in the boardrooms of the new South Africa.

Some say he was pushed by Mandela's protege and eventual successor, former President Thabo Mbeki. Ramaphosa withdrew from politics under Mbeki and set up an investment vehicle called Shanduka - which means "change" in the language of his Venda people.

Shanduka grew into one of the biggest Black-owned investment vehicles in South Africa. Ramaphosa was one of the main beneficiaries of the ANC's policy of Black Economic Empowerment, which was meant to reduce inequality but which critics say led to people with ANC connections acquiring assets at knock-down prices.

SILVER-TONGUED NEGOTIATOR

The son of a retired policeman, Ramaphosa was a thorn in the side of white mine bosses in the 1980s, leading the National Union of Mineworkers (NUM) that he co-founded in one of the largest strikes in the country's history.

He left the NUM in 1991 and was elected secretary-general of the ANC, in charge of the day-to-day running of the party, a year after it was unbanned by the apartheid government.

Ramaphosa's negotiating skills at constitutional talks in the early 1990s won him grudging respect from South Africa's last white president, F.W. de Klerk, who said Ramaphosa's "silver tongue and honeyed phrases lulled potential victims while his arguments relentlessly tightened around them".

Ramaphosa started winding down his business interests in 2012, when he became the ANC's No. 2 official under former President Jacob Zuma.

He replaced Zuma as ANC leader in 2017, vowing to rid the ruling party of graft and revitalise the economy.

But just as he was about to start campaigning for his second term as party chief, he faced calls to quit after an advisory panel found preliminary evidence that he may have violated the constitution over a large amount of cash found hidden in furniture at his game farm.

He has denied wrongdoing and was not charged with any crimes but his reputation took a hit from the incident dubbed "Farmgate".

CHAMPION OF GLOBAL SOUTH

Ramaphosa has been criticised for appearing to prevaricate on crucial reforms to avoid rifts within his party - a far cry from the decisiveness he showed as a union leader in the 1980s.

Policy changes on energy security, jobs and the green energy transition stumbled on internal party divisions, and several committees he created have only dragged out these disagreements.

But his supporters applaud his ability to preserve consensus and say he has made important achievements advancing South Africa's reputation as a champion of the so-called "Global South", shorthand for some low- and middle-income countries including India.

During the COVID-19 pandemic Ramaphosa was one of the most prominent voices globally calling for fairer distribution of vaccines.

More recently South Africa filed a genocide case against Israel at the International Court of Justice, leading judges to rule last week that Israel must halt its military assault on the Gaza city of Rafah. Israel has vehemently rejected the allegations.

Ramaphosa has campaigned on the ANC's successes over the last 30 years, but critics say he has offered little in the way of new solutions to South Africa's biggest challenges, including high crime and stark inequality.

At the ANC's final campaign rally before the election, he promised to "do better" before a crowd of tens of thousands of supporters gathered at a Soweto soccer stadium. Many filed out before he had finished his speech.

(Editing by Emelia Sithole-Matarise)

By Nellie Peyton and Alexander Winning