A gas company and a construction firm have been fined more than £1m after two men were injured in an explosion.
The pair, who were repairing a leaking gas main in Whitstable, Kent, "could easily have been killed" in the May 2016 blast, officials said.
Folkestone Magistrates' Court heard failings from both companies led to one employee suffering severe burns.
Southern Gas Network (SGN) was fined £1.2m and Cliffe Contractors Ltd was fined £60,000.
An investigation by the Health and Safety Executive (HSE) found the gas escape had been caused by employees of Cliffe damaging the main during construction work.
Gas ignited during the repair by SGN, causing the injuries to two of its own employees.
Around 600 homes in the area were left without gas overnight and witnesses said the explosion caused homes nearby to "shake".
The HSE report stated Cliffe had not followed safe digging techniques when excavating around the pipeline, which led to a "significant amount" of gas being released.
SGN also did not follow their own procedures, or recognised safe systems of work, when repairing the main, it stated.
The gas company, of Horley, Surrey, pleaded guilty to a breaching the Health and Safety at Work Act 1974.
During the sentencing hearing on Tuesday, it was also ordered to pay costs of nearly £19,000.
Cliffe Contractors, of Anthony's Way in Rochester also pleaded guilty, and ordered to pay costs of more than £12,000.
Speaking after the hearing, HSE inspector Martin Wayland said: "This incident, in which a worker could have easily been killed, could have been avoided.
"Companies should be aware that HSE will not hesitate to take appropriate enforcement action against those that fall below the required standards"