South African municipal election results will reveal whether the African National Congress (ANC) is losing its grip on power two decades after the end of apartheid.

The ANC has won more than 60 percent of the vote at every election since Nelson Mandela was sworn in as the country's first black president in 1994.

But 22 years after the fall of white-minority rule, a faltering economy, rampant corruption and high unemployment have eaten into the party's popularity.

Voters braved cold weather to queue outside polling stations on Wednesday, bringing an end to a campaign marked by disputes over alleged racial slurs.

READ MORE: South African local elections - ANC at a crossroads

Counting was under way on Thursday after South Africa's electoral commission said voting proceeded smoothly and without major incident.

Polls leading up to the vote had the main opposition Democratic Alliance (DA), which controls Cape Town, defeating the ANC in the capital Pretoria, Johannesburg and Port Elizabeth.

A final Ipsos survey earlier this week placed the ANC slightly ahead, as previously undecided voters climbed down from the fence.

Al Jazeera's Tania Page, reporting from Johannesburg, said: "This election is expected to be the closest one ever. The ANC's steady decline could be at a tipping point in several important metropolitan areas."

Smaller parties' role

Both the ANC and DA will probably find themselves forced to court smaller parties and independent candidates to piece together outright municipal majorities.

Contesting its first local election after it appeared on the scene before the 2014 general vote, the far-left Economic Freedom Fighters may find itself playing kingmaker.

READ MORE: South Africa local elections - A litmus test for ANC

A record 26.3 million people registered to choose mayors and other local representatives responsible for crucial issues including water, sanitation and power supplies.

The local vote is also seen as a mid-term reflection on the performance of the ANC and the leadership of President Jacob Zuma, who has been plagued by scandals since he took office in 2009.

Even if the ANC maintains its hold on power through inter-party alliances, any overall drop in support would be a loss, say analysts.

Inside Story - Is South Africa using the past to open way for the future?

Source: Al Jazeera and agencies