* Scandal-plagued Zuma quit at demand of ANC
* Rand soars to near 3-year high against dollar (Updates with Ramaphosa taking the helm)
CAPE TOWN, Feb 15 (Reuters) - Cyril Ramaphosa was elected as South Africa's president in a parliamentary vote on Thursday after scandal-ridden Jacob Zuma reluctantly resigned on orders from the ruling African National Congress.
South Africa's main stock market index jumped nearly 4 percent, putting it on track for its biggest one-day gain in more than two years as investors welcomed Zuma's resignation after nine years in office plagued by corruption allegations.
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.
But the road back to prosperity and self-respect under Ramaphosa, who became ANC head in December, will be long and hard in a nation still polarised 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 was elected unopposed as Zuma's permanent successor by parliament, and declared duly elected by South African Chief Justice Mogoeng Mogoeng.
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 towards an early exit after Ramaphosa replaced him as party president, but would accept its orders.
Ramaphosa's first state of the nation address was expected to take place on Friday. (Writing by James Macharia; editing by Mark Heinrich)