Firefighters and rescue workers dig for survivors after the explosion that ripped through Pemex's offices in Mexico City.

Mexico City - An explosion rocked the Mexico City headquarters of state oil giant Pemex on Thursday, killing one person, injuring more than 20 others and causing extensive damage to the building.

A local emergency official said one person had died in the blast and 22 others were injured. Another four people were trapped inside the skyscraper, the official said.

The blast, which media reports said was caused by machinery exploding, occurred in the basement, emergency officials said.

Pemex initially said the building had been evacuated because of a problem with its electricity supply. It then said there had been an explosion, but did not say what had caused it.

Lines of fire engines rushed to the entrance of the building and emergency workers in high-visibility jackets ferried injured people through paper and debris strewn on the street.

Television images showed windows blown out, and helicopters circled the building not far from the centre of the city.

Plaster had fallen from the ceiling of the basement, and the situation at the Pemex tower was “delicate”, a spokesperson for local emergency services said.

Pemex has suffered a number of lethal accidents in recent years. In September, 30 people died after an explosion at a Pemex natural gas facility in northern Mexico. - Reuters