Another 80 were wounded in the blast, State Interior Secretary Miguel Angel Osorio Chong said.
Emergency services are searching for people trapped in the rubble, the BBC's Will Grant reports from the scene.
Last September, 30 people died in an explosion at a Pemex gas plant in northern Mexico.
The 54-floor Pemex Executive Tower, which houses hundreds of employees, is located in a busy commercial area of Mexico City.
Television pictures showed rubble from the blast spread out on to the street in front of the building, and Red Cross ambulances on the scene attending to the injured, our correspondent in Mexico City reports.
Police have cordoned off the streets surrounding the building.
At this stage there is no official explanation for the explosion, our correspondent says.
The 54-floor Pemex building is 214 metres (702 feet) tall Trapped
Relatives of employees were gathering outside the building in search of information about their loved ones, local media report.
Some are said to have tried to reach employees on their mobile phones but had no reply.
"The place shook, we lost power and suddenly there was debris everywhere. Colleagues were helping us out of the building," eye witness Cristian Obele said.
Images of the blast posted on Twitter revealed large clouds of smoke billowing from the building. TV footage showed people being transported from the scene by helicopters.
President Enrique Pena Nieto and Mexico City Mayor Miguel Angel Mancera headed to the scene of the accident.
Mr Nieto said Pemex rescue and security teams were working alongside city authorities to help the injured.
"I am deeply sorry for the deaths of our fellow workers at Pemex. My condolences to their relatives," Mr Nieto said on Twitter.
"At the moment, the priority is to help the injured and protect the physical safety of those who work there."
The president said he has ordered an investigation into the causes of the blast.
Earlier on Thursday, Pemex had reported problems with the electricity in the building in a message on Twitter.
It later confirmed that an explosion had taken place "in the B2 building of the administrative centre".
"There are injuries and damage on the ground floor and mezzanine," it said on Twitter.
Plaster had fallen from the ceiling of the basement and the situation was "delicate", another spokesman for local emergency services was quoted by the Reuters news agency.
Pemex has experienced a number of accidents in recent years.
Last September's deadly blast at a gas plant near the northern town of Reynosa is thought to have been caused by a build-up of gas. http://www.bbc.co.uk/news/world-latin-america-21288214