South Africa's ANC is on track for its worst electoral performance since the end of apartheid as voters vent anger about high unemployment and corruption in municipal 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 percent of ballots counted.
Now a new era of coalition politics looks likely 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 Zuma's rivals within the ANC to challenge him.
The DA has retained control of Cape Town, which it has held since 2006.
Deputy President Cyril Ramaphosa said the party would do some soul searching, acknowledging that some critics had called the ANC "arrogant, self-centred, self-serving", but saying those descriptions were unfair.
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.
The party has its roots in the Progressive Party led by liberal whites who campaigned against apartheid during the era of white rule.
Final results are due on Saturday.
The ANC has lost its grip on the major cities where millions of black people are now looking beyond its liberation struggle credentials and focusing on weak growth prospects for an economy teetering on the edge of a recession.
Voters, facing a lack of jobs and poor basic services, have been incensed by a string of corruption scandals that have engulfed Zuma.
The radical leftist Economic Freedom Fighters (EFF) party, which is led by Julius Malema, Zuma's one-time protege, is participating in only its second election and was running a distant third in the votes counted.
It has, however, won some support from voters frustrated about inequality in a country where black people make up about 80 percent of the 54 million population, yet most land and companies remain in the hands of whites, who account for about eight percent of the population.
But neck-and-neck races between the ANC and DA in Johannesburg and Tshwane mean the EFF's 10 percent share of the vote could be needed for coalitions there.