South Africa's governing party has suffered its worst electoral showing since it took power in 1994 by ending the country's white-minority rule.
Results from nationwide municipal elections released on Thursday showed the African National Congress, or ANC, winning just over 46 percent of votes cast.
It was the first time that the party of late anti-apartheid leader Nelson Mandela failed to secure a majority in national or local elections.
The Democratic Alliance, backed mainly by white South Africans, came in second with about 22 percent of the vote. The left-wing Economic Freedom Fighters followed with about 10 percent.
President Cyril Ramaphosa, who heads the ANC, acknowledged public discontent over frequent power outages and rampant crime. He said people have told the party about "leaking houses, of frustration at electricity cuts, of feeling unsafe because of crime, and of being despondent after years of not working."
Ramaphosa called on the opposition parties to put aside their differences and work together in a spirit of cooperation.
The ANC faces the challenge of dealing with widespread corruption and economic disparity ahead of a general election in 2024.