Five families had to leave their homes when fire broke out at a gas sub-station in Milton Keynes.
Crews were called to Glyn Square, Wolverton, at about 2000 BST on Monday when the fire began.
More than 30 firefighters were needed to tackle the flames and residents were advised to stay inside and keep doors and windows shut.
The fire was put out and firefighters cooled exposed pipework to stop the sub-station catching fire again.
Some road closures around Glyn Square remain in place.