Petroleos de Mexico said on its Twitter account that the blast appeared to have been caused by an attempted theft of crude oil.
Four policemen and two firefighters who responded to the explosion and fire were injured in a secondary explosion, Pemex said.
The incident occurred in an open field near the municipality of Tonanitla, about 40 kilometers from Mexico City.