Electricity, water and sewerage services have been restored at Canterbury's three jails.
Earlier on Saturday, the earthquake forced Christchurch Mens' Prison, Christchurch Womens' Prison and Rolleston Prison to revert to back-up power generators.
A Corrections Department spokesperson, Karen Urwin, says the mains were reconnected at about 5pm and the prisons had a lucky escape.
She says some damage has been detected and structural engineers will be called in to inspect the buildings to check for any hidden damage.
The three prisons together have about 1500 inmates.