Image copyright Family Photos Image caption Julie Jones, Dennis Riley, Robert Broome and Andrew Jenkins died when a storage tank exploded

Four workers died when flammable gases ignited in a storage container and caused an explosion, a court has heard.

Dennis Riley, 52, Robert Broome, 48, Andrew Jenkins, 33, and Julie Jones, 54, were trying to empty the tank when it exploded at Pembroke oil refinery in June 2011.

Valero Energy UK Ltd and B&A Contracts admitted health and safety charges in October.

The firms are being sentenced at Swansea Crown Court.

A fifth employee, Andrew Phillips, was left with "terrible" life-changing injuries, the court heard.

The hearing was told the workers had been involved in trying to "pump out residue in the tank", which contained a mix of amine and diesel, when the flammable atmosphere ignited.

Andrew Langdon QC, for the prosecution, said all five workers had been near the storage tank, using a hosepipe inserted into the top of it to try to siphon off residue.

Image copyright Phil Horne Image caption The tank exploded at the refinery in June 2011

Mr Phillips, who had been standing slightly back from the rest of the group, remembered being covered by flames, the court heard.

Mr Langdon said experts had suggested dangerous vapours could have been ignited by static from a hose being lowered into the container by the workers, or by incoming air mixing with pyrophoric substances which can "ignite spontaneously on exposure to air".

The refinery was owned by Chevron at the time, but Valero has been named in proceedings because it bought the site after the blast.

Mr Langdon said Chevron had mistakenly classified areas within the tank at the time as "non hazardous" when they should have been listed as the most dangerous.

"Nobody was thinking about flammable gas," he said.

Mr Langdon told the court there had been a "serious drift of operation performances and procedures that were bound to have an impact on safety".

Families of the victims have been in court listening to the proceedings.

As case began on Tuesday, the Honourable Mr Justice Lewis said: "This is going to be a difficult time for everybody touched by that tragedy."

The hearing, which is expected to last for four days, continues.