South Africa's ruling party appears to be headed for its biggest electoral blow since it won power at the end of apartheid 22 years ago, with 95 percent of votes counted in local elections.

According to the most recent result on Friday, the Democratic Alliance (DA) won the majority of votes in Port Elizabeth, Cape Town and the economically important Western Cape Town province, where Cape Town is located. 

South Africa: Are students the key to real change?

Results remained too close to call in the country's largest city, Johannesburg, and the Tshwane metropolitan area around the capital, Pretoria, where the DA is also challenging the ANC.

Neither party appeared to be winning a majority in those two cities that would allow it to govern alone, raising the possibility of coalition governments.

"It's a pretty humbling day for the ANC, which is trying to put a positive spin on things," Al Jazeera's Tania Page reported from the capital, Pretoria.

Our correspondent said counting for the last 5 percent of the vote slowed down in some areas, which are densely populated and hotly contested.

The ANC also lost a key municipality named after its star, Nelson Mandela Bay, to the DA.

The ANC, formerly the main anti-apartheid movement, has lost some support from people who say their hopes for economic opportunities have not been fulfilled since the end of white minority rule.

WATCH: Is Zuma turning South Africa into a 'mafia state'?

The South African economy has stagnated since the global financial crisis in 2008.

Somododa Fikeni, a political analyst with the University of South Africa, told Al Jazeera that the result of the local elections could force the ruling party to "listen and think more carefully" about its policies.

In a statement, the ANC said "we will reflect and introspect where our support has dropped".

Scandals swirling around President Jacob Zuma have also hurt the ANC.

A more radical opposition party, the Economic Freedom Fighters, also contested the local elections for the first time. The party, which advocates the nationalisation of industry and other measures it says will help the poor, has garnered almost 8 percent of the vote nationwide.

Source: Al Jazeera and agencies