The second-largest blackout on record worldwide is finally just about over.

More than nine months after Hurricane Maria struck, the Puerto Rico Electric Power Authority is reporting that it has restored power to 99.9 percent of its customers:

La AEE alega que le restableció el servicio al 99.9% de sus abonados -CC1 https://t.co/uzwmT2tJO0 — AEE (@AEEONLINE) July 3, 2018

That still leaves 1,942 customers without electricity, mainly in the island’s remote, mountainous center. But every municipality is now receiving power, which is progress.

It’s been a long, painful, and bumpy road for recovery workers to reach this point. After Hurricane Maria knocked down 80 percent of Puerto Rico’s transmission lines, restoration efforts were marred by mistakes, poor planning, and potential criminal acts.

Along the way, the 3.3 million Americans in Puerto Rico suffered intermittent power, including an island-wide blackout in April. The outage following Hurricane Maria is the worst in US history and the second-largest in the world. (The only event with a greater impact on electricity service was Typhoon Haiyan in 2013, one of the biggest tropical storms to ever make landfall and the deadliest one to hit the Philippines.)

The lack of reliable electricity in Puerto Rico also proved exceptionally deadly as vital medical equipment couldn’t be used, drugs like insulin couldn’t be refrigerated, and air conditioners shut off as the island faced a heat wave. Infections from diseases like leptospirosis spread as sanitation systems went offline.

The government says it is waiting for results from a study by researchers at George Washington University before it updates the official death toll of 64. But Harvard researchers estimated in June in the New England Journal of Medicine that more than 4,600 people likely died as a result of the storm.

Even with electricity running, the lingering worry is that Puerto Rico’s power grid remains vulnerable to another storm. Many of the repairs were stopgap measures, and regulations like the Stafford Act limited the reconstruction to restoring the system as it was rather than making upgrades to ensure it could better withstand another disaster.

Now we’re in another hurricane season. If a new fierce storm blows through Puerto Rico, the darkness could return.