A huge blaze twisted and blackened an oil platform in the Gulf of Mexico, but the state-run Pemex oil company said it managed to avert any significant oil spill.

At least four workers died and two suffered life-threatening injuries in an explosion that engulfed the platform in flames Wednesday, forcing 300 people to abandon the facility.

Officials said environmental damage was avoided because the fire happened on a processing platform where the feeder lines could be turned off, rather than at an active oil well with a virtually unlimited amount of fuel flowing up from the seabed.

In a statement Wednesday night, Pemex said the accident "did not cause an oil spill into the sea, given that there was only a seepage, which is being taken care of by specialized vessels." It suggested the oil remaining in the pipelines was burning off.

The company's official Twitter account announced late Wednesday that fire had been extinguished after hours of being showered with water sprayed from 10 firefighting and emergency boats.

Pemex Director General Emilio Lozoya said the accident "would have a minimal impact on production, because this was a processing platform," not a producing well. Production from nearby wells it normally serves could be rerouted to other processing platforms.

Lozoya said the explosion appeared to have been set off by some kind of mechanical problem but the precise cause was still under investigation.

Helicopters flew workers with bandaged hands and faces and burn marks on their overalls to the nearby city of Ciudad del Carmen, where crowds of relatives of oil workers thronged outside hospitals. Pemex said a total of 45 workers received medical treatment or evaluation.

A survivor of the blaze on the shallow-water Abkatun-A Permanente platform in the Campeche Sound said workers "jumped into the sea out of desperation and panic."

"There was nothing you could do but run," said Roger Arias Sanchez, an employee of Pemex contractor Cotemar who escaped the burning platform in an evacuation boat.

Many of the injured appeared to be Cotemar employees.

President Enrique Pena Nieto promised an investigation to "find whoever is responsible" and avoid such accidents in the future.

Previous spills from Mexican facilities have usually occurred at active offshore wells, not processing stations such as Abkatun.

Abkatun lies off the coast of the states of Campeche and Tabasco. It is farther out to sea than the platform involved in the last severe fire in the area, a 2007 blaze at the Kab 121 offshore rig.

That accident was caused by high waves that hit the rig, sending a boom crashing into a valve assembly. The blaze killed at least 21 workers and the rig spilled crude and natural gas for almost two months.

Mexico's worst major spill in the Gulf was in June 1979, when an offshore drilling rig in Mexican waters, the Ixtoc I, blew up, releasing 140 million gallons of oil. It took Pemex and a series of U.S. contractors nearly nine months to cap the well, and a great deal of the oil contaminated Mexican and U.S. waters.

Pemex has had serious security problems in the past, mainly in its onshore pipeline network, where thieves drilled around 2,500 illegal taps in the first nine months of 2104 and stole more than $1 billion in fuel.

That problem got so bad that in February, the company announced it would no longer ship finished, usable gasoline or diesel through pipelines.

That apparently hasn't stopped the thieves, though. On Wednesday, federal police announced they had seized three tanker trucks and 148,000 liters (39,100 gallons) of stolen fuel at several different sites throughout the country as well as locating two illegal pipeline taps.