There were also reports that as many as 30 people were trapped in the debris from the explosion, which occurred in the basement of an administrative building next to the iconic, 52-story tower of Petroleos Mexicanos, or Pemex.
There was no immediate cause given for the blast, which also damaged the first and second floors of the auxiliary building in a busy commercial and residential area. But in an earlier Tweet, Pemex said it had evacuated the building as a precautionary measure because of a problem with the electrical system.
"It was an explosion, a shock, the lights went out and suddenly there was a lot of debris," employee Cristian Obele told Milenio television, adding that he had been injured in the leg. "Co-workers helped us get out of the building."
The tower, where several thousand people work, was evacuated. The main floor and the mezzanine of the auxiliary building, where the explosion occurred, were heavily damaged, along with windows as far as three floors up.
"Right now they're conducting a tour of the building and the area adjacent to the blast site to verify if there are any still trapped so they can be rescued immediately," Interior Ministry spokesman Eduardo Sanchez told Milenio.
A reporter at the scene saw rescue workers trying to free several workers trapped. Television images showed people being evacuated by office chairs, and gurneys. Most of them had injuries likely caused by falling debris.
"We were talking and all of sudden we heard an explosion with white smoke and glass falling from the windows," said Maria Concepcion Andrade, 42, who lives on the block of Pemex building. "People started running from the building covered in dust. A lot of pieces were flying."
Police landed four rescue helicopters to remove the dead or injured. About a dozen tow trucks were furiously moving cars to make more landing room for the helicopters.
Streets surrounding the building were closed as evacuees wandered around, and rescue crews loaded the injured into ambulances.
"I profoundly lament the death of our fellow workers at Pemex. My condolences to their families," President Enrique Pena Nieto said via his Twitter account.
Shortly before the explosion, Operations Director Carlos Murrieta reported via Twitter that the company had reduced its accident rate in recent years. Most Pemex accidents have occurred at pipeline and refinery installations.
A fire at a pipeline metering center in northeast Mexico near the Texas border killed 30 workers in September, the largest-single toll in at least a decade for the company.