South Africa's Constitutional Court said on Tuesday local elections could go ahead in August, quashing speculation of a delay after a lower court demanded the addresses of all registered voters be verified before the vote could take place.

Some opposition parties and independent candidates have said addresses must be verified to ensure the vote is not compromised, arguing electors without addresses could travel to municipalities where they do not live to vote there.

The local elections on Aug. 3 pose a major test for President Jacob Zuma’s African National Congress (ANC), with the party facing a strong challenge from opponents amid a struggling economy.

The Constitutional Court said that while the voter roll was "unlawful, inconsistent with the constitution, and therefore invalid", it was unreasonable to expect the Independent Electoral Commission (IEC) to correct errors before the local elections.

The IEC then asked the Constitutional Court, the country's top court, to give a go-ahead for the vote using the existing voter register with about 12 million voters with no addresses, some of whom live in informal settlements and rural areas.

The Constitutional Court gave the IEC 18 months to update its voter rolls, paving way for the local elections to proceed.

Analysts said the ruling had averted a crisis.

"It's a pragmatic judgment," said Daryl Glaser, head of political studies at Johannesburg's Wits University, adding a ruling to postpone the elections could have led to "a constitutional crisis."