South Africa's ANC is on track for its worst electoral performance since the end of apartheid as voters vented anger about high unemployment and corruption in local elections that herald a sea change in politics and society.

The African National Congress has ruled virtually unopposed since it ended white-minority rule in 1994 with Nelson Mandela at its helm, but has lost support - particularly in cities - among voters who feel their lives have not improved and accuse President Jacob Zuma of mismanaging the economy.

The ANC was still leading in the overall count in the nationwide municipal vote, with 95% of ballots counted.

But it lost to the main opposition Democratic Alliance (DA) in the municipality of Nelson Mandela Bay, which includes the city of Port Elizabeth.

The DA was also narrowly ahead in the economic hub of Johannesburg, and the two parties were on par in Tshwane, home to the capital Pretoria.

The ANC has previously held full control of these areas.

No party looks likely to win a majority in these three urban centres, ushering in a new era of coalition politics as South Africa shifts from what has effectively been a one-party system in the period immediately post-apartheid.

This shift reshapes the political landscape in South Africa ahead of the 2019 national election, and may also embolden Mr Zuma's rivals within the ANC to challenge him.

ANC chief whip Jackson Mthembu said the losses across the country were "a worrying trend" for the ruling party and would prompt soul-searching. "We need to have a serious introspection, and that is what we will do."

The election also represents a political renaissance for the DA, which last year elected its first black leader, Mmusi Maimane, as part of its efforts to shake off its image as a party that mainly serves white interests.

"In the region named after Nelson Mandela, who promoted reconciliation, I think it is fitting that we have to cooperate with other political parties," said Athol Trollip, the DA's mayoral candidate in the bay area.

Final results are due tomorrow.