Johannesburg has settled R5.26 billion, about $328 million, in overdue electricity debt owed to Eskom, removing the immediate threat that South Africa’s state-owned utility could restrict power supplied to the country’s commercial capital.

Eskom confirmed on Friday, August 21, that it had received the final payment from the City of Johannesburg and its electricity distributor, City Power.

The settlement covers accumulated overdue debt of R5,255,421,994.16 and brings an end to a dispute that had reached the courts and triggered a formal process towards restricting the city’s electricity supply.

Johannesburg is ranked as Africa’s wealthiest city by private wealth, according to the Africa Wealth Report. It is home to about 11,500 dollar millionaires and two billionaires, as well as many of the companies listed on the Johannesburg Stock Exchange.

Despite that concentration of wealth, the city has struggled with weakening finances, deteriorating roads, unreliable water supplies and ageing electricity infrastructure.