A photograph in the entrance hall at Komati Power Station shows the plant in better times, its nine generating units belching steam and smoke into the night sky.

Those days are never coming back: Komati’s sole remaining working unit is facing closure within two years under plans by state power utility Eskom Holdings SOC Ltd. to shut about a quarter of its coal-fired capacity by 2030. Next door at the Goedehoop mine, arrays of solar panels line the main access road, a sign of what may be to come for South Africa’s coal belt.

The blackouts suffered by swathes of the U.S. this week show what’s at stake for even the world’s most advanced economies in getting the transition to cleaner energy right. In South Africa, for decades almost all the electricity needed to power Africa’s most industrialized economy has been produced by a fleet of aging coal-fired plants constructed alongside the mines to the east of Johannesburg. That’s made the province of Mpumalanga, in which Komati is located, one of the most coal-dependent and polluted regions on Earth.