JOHANNESBURG (AP) — South Africa's ruling party has suffered its biggest election setback since taking power at the end of apartheid a generation ago, with local media reporting that the African National Congress has lost the metropolitan area that includes the country's capital, Pretoria.
The opposition Democratic Alliance party edged out the ANC in Tshwane, though it did not win a majority, raising the likelihood of a coalition government.
Meanwhile, with less than 1 percent of votes left to be counted, the race for the largest city, Johannesburg, remained too close to call. Final results of municipal elections were being announced at 6 p.m. (1600 GMT).
The election has been notable for its peaceful power shift away from an entrenched government in Africa, testifying to the strength of South Africa's democracy. In contrast, 92-year-old President Robert Mugabe in neighboring Zimbabwe has kept control since independence in 1980 with a series of disputed elections and crackdowns on dissent.
Since South Africa's first all-race election in 1994, the ANC has had widespread support on the strength of its successful fight against white-minority rule, while bringing basic amenities to many people who had had none. But this time, it has been challenged by corruption scandals and a stagnant economy that has frustrated the urban middle class, while protests in poor communities demanding better services have been common.
"Election after election, the ANC has hung on to its past glory and kept its place in the hearts of most South Africans. ... This time round, though, it's not enough," the Mail & Guardian newspaper said in an editorial . On social media, South Africans mocked President Jacob Zuma's recent claim that the ANC would rule "until Jesus comes back."
The ANC also 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 Democratic Alliance, which has roots in the anti-apartheid movement and had a white party leader until last year, won Nelson Mandela Bay after fielding a white candidate for mayor. The party already runs the country's second largest city, Cape Town, the only major South African city where blacks are in the minority among white and mixed-race residents. It has been pushing hard to win supporters in other regions, saying its brand is good governance.
The party's leader, 36-year-old Mmusi Maimane, had predicted victory in Tshwane.
"For far too long, the ANC has governed South Africa with absolute impunity," Maimane told reporters Saturday. He said the idea that his party was a white one has been "completely shattered."
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."
Maimane immediately looked ahead to presidential elections. "The 2019 campaign starts now," he said.
The ANC so far has received 53 percent of votes across the country, its lowest percentage ever, with the Democratic Alliance getting 26 percent. A more radical opposition party, the Economic Freedom Fighters, contested the local elections for the first time and received 8 percent of the vote nationwide after promising measures it says will help the poor.
The results for the ANC could put pressure on the 74-year-old Zuma to leave office before his mandate ends in 2019, political analysts said. Zuma's office said Saturday that he would attend the announcement of the final election results.
The ANC has said "we will reflect and introspect where our support has dropped." It retained support in many rural areas in a country where blacks make up 80 percent of the population.
The South African economy has stagnated since the global financial crisis in 2008, and the World Bank says the country has one of the highest rates of inequality in the world.
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.
Associated Press writer Christopher Torchia in Johannesburg contributed.