South Africa’s African National Congress (ANC) has been returned to office after winning parliamentary election, but with a reduced majority.
The ANC secured 58% of the vote, ahead of the Democratic Alliance (DA) on 21%. The radical Economic Freedom Fighters (EFF), came third with 11%.
The ANC, which has been in power since 1994, won 62% of the vote at the last general election in 2014.
Anger over the economy and corruption may have eroded its appeal.
Turnout was about 65% in the twin parliamentary and provincial elections – a drop compared to the 73% registered five years ago.
Some six million young people did not register to vote.
This has been a critical election for the man promising to defeat corruption and boost a stagnant economy.
ANC leader Cyril Ramaphosa will now argue that he has a mandate to create a cabinet capable of reducing unemployment that runs at 27% – more than half of it among the young.
That means sidelining allies of his scandal-plagued predecessor Jacob Zuma.
They will however remain entrenched in the structures of the ANC, unless prosecutions or the reports of public inquiries into corruption force them to quit.
Perceptions of honest government are critical if Mr Ramaphosa is to attract the investment South Africa needs.
This is Africa’s largest economy and tackling its inability to provide jobs for the young is the great challenge ahead.
In a country where the youth have traditionally led rebellions – in 1976 and again in the mid-1980s against apartheid – the most striking statistic in this election is the fall-off in voting by young people.
More than six million did not register to take part – roughly half of those in the 18-30 age bracket who were entitled to vote.
Disenchantment over corruption and the failure to provide jobs is deep.
It is a trend of alienation that Mr Ramaphosa will need to stem if the long-term health of democracy here is to be guaranteed.
Casting his vote in the country’s sixth democratic national election since apartheid ended 25 years ago, President Ramaphosa acknowledged the “rampant corruption” of recent years.
“We have made mistakes but we have been sorry about those mistakes and we are saying our people should reinvest their confidence in us,” he said.
“Corruption got into the way, patronage got into the way and not focusing on the needs of our people got in the way.”
Why has the ANC lost support?
Young people queuing to vote spoke of their difficulties in finding jobs.
One young voter said her future employment prospects were on her mind. “I don’t feel confident about getting the job I want,” she said.
“I’m a member of the ANC, but I didn’t vote for them this time,” construction worker Thabo Makhene told Reuters news agency. “They need to catch a wake-up. The way they run the state, mishandling state funds, they’ve lost their morals.”
However, many voters stayed loyal to the ANC, which led the fight against apartheid.
Esau Zwane, 90, waiting to vote in Soweto, Johannesburg, lived under white-minority rule. He told the BBC he was celebrating “that our country is now ruled by black people”.
Votes are cast for parties, with seats in the 400-member National Assembly allocated according to the share of the vote gained by each party.
These MPs then elect a president.
Election in numbers:
26.76 million registered voters
55% of them are female
A record 48 parties on the ballot
28,757 voting stations
220,000 members of electoral staff
Six million young people did not register to vote
How big an issue is land reform?
Apartheid, in place from 1948 to 1994, legalised racial discrimination in favour of white people, and land ownership has remained a contentious issue.
The white minority still owns disproportionately more land than the black majority. The EFF has led the charge in trying to change this.
Andrew Harding says the party’s stance has forced the ANC to consider drastic measures to transfer more land, more quickly, into black hands, which has resulted in a pledge to conduct land expropriation without compensation.
However, the DA says it does not believe land reform needs to be “carried out in a way that takes from one to give to another”, and instead promises to prioritise land reform in the budget and to release unused government land.
Other election issues include discontent over poor basic services such as water, housing and electricity, and anger over violent crime.
As well as the continued inequalities, it is thought that the failure to tackle corruption has damaged the ANC.
President Ramaphosa came to power last year pledging to get to grips with the issue, but some voters still associate the party with the corruption which thrived under his predecessor, Jacob Zuma.
Mr Zuma faces trial on numerous charges of corruption, but has denied any wrongdoing.
Votes are cast for party lists with seats in the 400-member National Assembly allocated according to the percentage vote of each party.
These MPs then elect a president.