Lanark Sheriff Court heard that, on 22 March 2007, Turriff Contractors Limited had been contracted to construct and install a gas main on a street in the town.
The court also heard that, on 25 March 2012, the gas main Turriff constructed and installed failed and caused extensive damage to a bungalow on the street.
The two occupants of the bungalow escaped with minor injuries.
An HSE investigation found the cause of the explosion was due to the poor construction of the gas main in 2007, the company also failed to adequately supervise the construction and installation of this gas main.
It was found that the gas main was constructed near to a low voltage electrical cable which later short circuited and the heat generated from this caused the release of natural gas subsequently leading to the gas explosion.
Turriff Contractors Limited of Glasgow, pleaded guilty to safety breaches and were fined £80,000.
Speaking after the hearing HSE head of gas and pipelines Julie Voce said: “It was very fortunate the two residents escaped this life-threatening incident with minor injuries.
“Duty holders must construct and install all gas pipelines to the required standard. In this case Turriff Contractors failed to do so and we hope that lessons have been learned to avoid similar events occurring in the future.”