CAPE TOWN (Reuters) - Cyril Ramaphosa was elected as South Africa’s president in a parliamentary vote on Thursday and pledged to tackle endemic corruption after scandal-ridden Jacob Zuma resigned on orders from the ruling African National Congress.

The road back to prosperity and self-respect under Ramaphosa, 65, who became ANC head in December, will be long and hard in a nation still polarized by race and inequality more than two decades after the end of white-minority rule.

Still, Zuma’s departure late on Wednesday provided evidence of the strength of South Africa’s democratic institutions, from the courts to the media and the constitution.

Ramaphosa, in brief remarks to parliament ahead of his first state of the nation address expected on Friday, said he would work hard “not to disappoint the people of South Africa”.

GRAPHIC - tmsnrt.rs/2o2wlJz

“The issues that you have raised, issues that have to do with corruption, issues of how we can straighten out our state-owned enterprises and how we deal with state capture (influence-peddling) are issues that are on our radar screen,” he said.

Ramaphosa was elected unopposed as Zuma’s permanent successor by parliament, and confirmed in the post by South African Chief Justice Mogoeng Mogoeng, who had earlier read out the former president’s resignation letter.

Ramaphosa was expected to be sworn in later on Thursday, and to make any changes to the cabinet after his address on Friday.

The rand, which has gained ground whenever Zuma ran into political turbulence, soared to a near three-year high against the dollar on word of his resignation.

South Africa’s main stock market index jumped nearly 4 percent and headed for its biggest one-day gain in more than two years as investors hailed Zuma’s exit after nine years in office rife with allegations of sleaze and mismanagement.

Ratings agency Moody’s said it was closely monitoring developments in South Africa, focusing on the policy implications of Zuma’s political demise.

The S&P Global agency said South Africa’s sovereign credit ratings and outlook will not be immediately affected by the change of the country’s leadership.

UPHILL CHALLENGE

Ramaphosa, who will be president until elections next year, faces an uphill battle to earn back public and investor support.

But his stated commitment to boosting growth and stamping out graft has gone down well with foreign investors and ANC members who felt Zuma’s handling of the economy could seriously damage the party in the 2019 election.

Africa’s most developed economy needs faster economic growth if it is to reduce high unemployment - currently at 27 percent - and alleviate persistent, widespread poverty that aggravates inequality and stokes instability.

The economy, Africa’s most advanced, remains largely under the control of whites who held power under apartheid.

Slideshow ( 10 images )

The 75-year-old Zuma said in a 30-minute farewell address to the nation he disagreed with the way the ANC had thrust him toward an early exit after Ramaphosa replaced him as party president, but would accept its orders.

“Zuma did the right thing to resign. Yes, let’s see what Ramaphosa is having for us, thank you,” said Hlengiwe Mswazi, an office worker in the capital Pretoria.

Tshepo Kgobane, also in Pretoria, said: “So it is a good thing that he resigned. We must have a party, a big party, we must throw a party because he resigned. We wanted to see that.”

Zuma bowed out hours after police raided the luxury home of the Gupta family, the Indian-born billionaire allies of the former president who have been at the center of corruption accusations against Zuma and his circle for years.

Slideshow ( 10 images )

Zuma and the Guptas have always denied wrongdoing.

“GOING, GOING, GONE”

“Defiant in defeat” and “Going, Going, Gone” were among the newspaper headlines that captured Zuma’s unwillingness to leave.

“South Africa’s long nightmare is over,” read the headline from online political news website Daily Maverick.

Julius Malema, leader of the far-left Economic Freedom Fighters (EFF), led his party in a mass walkout from parliament on Thursday, saying it would not take part in the election of a new president so as not to legitimize an ANC candidate.

The EFF, which has six percent of the seats in parliament, had sponsored a no-confidence motion in Zuma that would have gone ahead on Thursday had Zuma not jumped.

The foundation set up to guard the legacy of the late anti-apartheid icon and first black South African president Nelson Mandela said Zuma’s departure brought to an end “a painful era for the country”.

“One chapter in South Africa’s political soap opera has finally ended with the resignation last night of President Jacob Zuma,” NKC African Economics analysts wrote in a note.

“It would be gratifying to see the dedication and purpose the ANC put into ridding itself of Zuma now be directed into rebuilding the economy, dealing with the corruption still residing in the ANC and improving its shoddy governance record.”

South African police said officers had arrested eight people so far in its investigations into high-echelon influence-peddling revolving around the Gupta family.

Chief prosecutor Shaun Abrahams declared Ajay Gupta, one of the three Gupta brothers, a “fugitive from justice” after he failed to hand himself in. Abrahams provided no further details.

State broadcaster SABC said a Gupta family member was among those detained, while a senior judicial source said police were expected to arrest up to seven more people and that Gupta family members would be among them.

Police said the raid on the Gupta estate was in connection with a state-funded dairy farm, which prosecutors last month called a “scheme designed to defraud and steal”.