South Africa's ruling party is facing its biggest election setback since it took power at the end of apartheid 22 years ago.
Final results of municipal elections are being announced on Saturday. Races remained too close to call in the country's largest city, Johannesburg, and Tshwane, the metropolitan area of the capital, as less than 1% of votes were left to be counted.
The African National Congress for a generation had widespread support on the strength of its successful fight against white-minority rule. But it has been challenged by corruption scandals and a stagnant economy that has frustrated the country's urban middle class.
The ANC already has lost its first major black-majority municipality in this election, Nelson Mandela Bay, named for the ANC's star and the country's first black President.
The opposition Democratic Alliance, which has roots in the anti-apartheid movement and was white-led until last year, won Nelson Mandela Bay after fielding a white candidate for mayor.
The party's leader, Mmusi Maimane, also has predicted victory in Tshwane.
The Democratic Alliance already runs the city of Cape Town, the country's second largest and the only major South African city where blacks are not in the majority. It has been pushing hard to win supporters in other regions.
The Democratic Alliance angered the ANC last month by declaring that it was the only party that could realize Mandela's dream of a "prosperous, united and non-racial South Africa."
Neither party appeared to have a majority in Johannesburg or Tshwane that would allow it to govern alone, raising the possibility of coalition governments.
The results for the ANC could put pressure on President Jacob Zuma to leave office before his mandate ends in 2019, political analysts said.
Scandals swirling around Zuma have also hurt the ANC. Opposition groups have seized on the revelation that the state paid more than $20 million for upgrades to Zuma's private home.
The Constitutional Court recently said Zuma violated the constitution and instructed him to reimburse the state $507,000.
Many South Africans are also concerned over allegations that Zuma is heavily influenced by the Guptas, a wealthy business family of immigrants from India. The President has denied any wrongdoing.