Cyril Ramaphosa replaced Jacob Zuma as president in 2018 after a bitter power struggle
South Africa's President Cyril Ramaphosa is under growing pressure after leading the ruling African National Congress (ANC) to its worst election result in 30 years, forcing it to share power.
With almost all the votes in from Wednesday's poll, the ANC is on 40% – down from 58% at the previous election.
This is lower than the party's feared worst-case scenario of 45%, analysts say.
The ANC has always polled above 50% since the country's first democratic elections in 1994, which saw Nelson Mandela become president.
But support for the party has been dropping significantly because of anger over high levels of corruption, unemployment and crime.
Citing the cost-of-living crisis and frequent power cuts, one woman told the BBC she had voted for the ANC for the past 30 years, but had backed the centre-right Democratic Alliance (DA) this time.
"This result is not good. I wanted it out of government. We need to give someone else a chance," she said.
At a briefing late on Saturday, electoral commission head Mosotho Moepya said it would be ready to announce the full results on Sunday.
The commission said all objections raised by a number of political parties would be reviewed, and recounts would be ordered if needed.
The BBC understands the final results will be announced at 18:00 local time (17:00 BST).
This is when we will know exactly how many seats each party has in the National Assembly, although South Africa has a strict system of proportional representation, so we already have a pretty good idea.
Saturday's reactions and results as they happened
Who's up, who's down – and why
The ANC leadership, including President Ramaphosa, is currently discussing the way forward and preparing for complex coalition talks, a source told the BBC.
Its options are a coalition with the DA, which is in second place on 22%, or the uMkhonto weSizwe (MK) party led by former President Jacob Zuma, on 15%.
The radical Economic Freedom Fighters (EFF) is on 9%, so a coalition of those two parties would fall just short of the required 50%.
The new parliament must be sworn in within two weeks of the final results and the new president would normally be chosen then.
Both the EFF and MK advocate seizing white-owned land and nationalising the country's mines – policies which would alarm foreign investors.
The MK has said it would be prepared to work with the ANC, but not while it was led by Mr Ramaphosa.
He replaced Mr Zuma as both president and ANC leader following a bitter power struggle in 2018.
MK supporters have been celebrating overnight in Durban, the biggest city in the party's heartland of KwaZulu-Natal province. The party was only formed in September.
ANC chairperson Gwede Mantashe said his party was unlikely to form an alliance with the DA.
He said there would have to be "policy alignment" between parties to form a coalition agreement.
For the ANC, its black empowerment policies – aimed at giving black people a stake in the economy following their exclusion during the racist apartheid era – were "non-negotiable".
Support for the DA has grown in this election
He added that any coalition partner would have to agree to the National Health Insurance (NHI) Bill, which promises universal healthcare for all, signed into law earlier this month.
The DA opposes both the NHI and the ANC's black empowerment policies.
Why South Africa's health insurance is causing ructions
When will we get the results?
Despite the ANC's reluctance to align with the DA, its leader John Steenhuisen hasn't ruled out the idea.
But if an alliance with the ANC was reached, there would be a few non-negotiables, he said.
"Respect for the rule of law and the constitution, a social market economy that treats the private sector as partners in the growth agenda.
"Zero tolerance for corruption and cadre deployment, and an absolute laser-like focus on economic policies that grow jobs."
Mr Steenhuisen also told the BBC he would have to consult pre-election coalition partners before considering any negotiations.
But he ruled out the EFF and the MK party as potential coalition partners.
"I think instability is not in the best interest of the country. A coalition with the radical left in South Africa of the MK party and the EFF will produce the same policies that destroyed Zimbabwe, destroyed Venezuela," he said.
A record 70 parties and 11 independents were running, with South Africans voting for a new parliament and nine provincial legislatures.
The DA has signed a pact with 10 of them, agreeing to form a coalition government if they get enough votes to dislodge the ANC from power.
But this does not include the EFF or MK, who would be needed to form a majority.
As the parties scramble to form alliances, Kenya's former President Uhuru Kenyatta, who is leading the African Union election observer mission in South Africa, offered some advice for forming coalitions.
He said coalition governments need to focus on areas of agreement instead of differences.
"I can only wish them well and hope that the leadership will take this decision by the people in a positive frame," he said.
Additional reporting by Nomsa Maseko and Anthony Irungu
South Africa in eight charts
Cyril Ramaphosa – South African union leader, mine boss, president
John Steenhuisen: The DA leader vowing to 'rescue' South Africa
Julius Malema – the radical agenda-setter
Jacob Zuma – the political wildcard
Go to BBCAfrica.com, external for more news from the African continent.
Follow us on Twitter @BBCAfrica, external, on Facebook at BBC Africa, external or on Instagram at bbcafrica, external
Africa Daily
Focus on Africa
South Africa's ANC has to share power after election blow
Labour plans apprenticeship funding shake-up
Tories pledge new GP surgeries in community care boost
How UK's 'fastest' rollercoaster ground to halt within day of opening
Will using Western weapons on Russia help Ukraine change the war?
'This is a bad day for America' – voters split on Trump verdict
'The death of Slim Shady': Controversial legacy of Eminem's peroxide-blond alter ego
We have no Plan B if Ukraine falls, says Estonia
'Milton Keynes roundabouts helped me with Formula 1'
Labour's long war inflicts Starmer's first campaign stumble
Classic film track voted best 90s Bollywood song
Migrants and drugs – why Mexico's election matters to the US
Lily Allen shares her pivotal cultural influences
She reflects on her childhood and the pressures of life in the spotlight
The Outlaws must race against time to prove their innocence
Stephen Merchant’s comedy thriller has returned to iPlayer with a brand-new series
How did a Brazilian flip-flop take over the world?
Hear about the birth of this iconic footwear and how it became a global success story
Peter Parker swings into a tangled web of universes
Watch Marvel's blockbuster, multi-verse epic, Spider-Man: No Way Home, on iPlayer now
The final leg of an epic race…
Jaws will drop and spines will tingle
Discovering the wonders of Uganda
Discover Scotland's best football stars
© 2024 BBC. The BBC is not responsible for the content of external sites. Read about our approach to external linking.

More Stories
The World Cup of Internet Resilience
Community-Centered Connectivity Initiatives Earn Viddy Awards Recognition
Zombie IXPs: The Four Types of Exchanges That Refuse to Die, but Fail to Live