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 said on 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.