Christchurch Hospital has restored power after a "major" outage struck earlier on Friday night.
Patients were warned to avoid the hospital unless it was an emergency after a network outage left some areas in total darkness.
The outage affected all systems including power, IT and phones.
In an update from Te Whatu Ora - Canterbury DHB, it said the Parkside and Riverside buildings are back on mains power, while the Waipapa acute services building is currently being powered by back-up generators.
"We will be reviewing why the generators didn't automatically connect to the hospital's systems when the power failed," a spokesperson said in a statement.
"Thankfully all 478 patients in our care, including 96 in ED at the time the power went out are safe.
"We appreciate the support of St John, Civil Defence, the 24-hour surgery as well as our own staff, including those who came in to work on restoring our systems."