An accident on an oil well-maintenance platform killed two workers and injured 10 off Mexico's coast on Tuesday, company officials reported, blaming the incident on the collapse of one of the rig's legs.

State oil company Petroleos Mexicanos, or Pemex, said the Troll Solution rig was maneuvering to perform offshore maintenance at the time of the accident in the Bay of Campeche, in the Gulf of Mexico.

Pemex blamed a structural failure in the leg. The rig was "listing" but had not sunk, the company said via Twitter.

Pemex said in a statement that the platform belongs to oil services provider Typhoon Offshore. Ninety-eight of that company's workers and three Pemex employees were removed from the rig and taken for medical evaluation.

Mexican conglomerate Grupo Salinas, the parent company of Typhoon Offshore, said 10 workers were injured and had been treated.

"The platform has all the safety mechanisms necessary for an infrastructure of this magnitude," Grupo Salinas said in a statement. "Unfortunately, despite safety measures, accidents happen."

Pemex said production was not affected.