The judgement is a blow to the ruling African National Congress (ANC), which supported a postponement and has struggled to register thousands of councillors expected to contest the municipal elections.
This time the polls will test support for the ANC following the coronavirus pandemic and South Africa’s worst civil unrest in years in July, triggered by the jailing of former President Jacob Zuma after he failed to appear before an anti-corruption inquiry.
ANC spokesman Pule Mabe told broadcaster SABC that the party welcomed the judgement and would study it properly before commenting further.
The Electoral Commission said in a statement it would meet over the weekend to chart a way forward, and would make an announcement about the electoral programme on Monday.
In August, the Electoral Commission applied to have the elections postponed after an inquiry recommended a delay because of the pandemic.
In its ruling, the court set aside the government’s decision to have elections on October 27, saying instead the polls must go ahead between that date and November 1.
The commission must, within three days of the court order, determine if it was “practically possible” to hold a voter registration weekend ahead of people casting their ballot, it ordered.