Pablo Bedolla, mayor of the Mexico City suburb of Ecatepec, said 20 people died in the blast that engulfed early morning traffic. Television footage showed burned out vehicles and debris strewn all over the highway on the edge of the capital.
"It was a ball of fire which exploded as though they'd put a spotlight in the whole window," resident Carlos Gonzalez Silva told Mexican radio. "We opened the door and it was like fire had blown through the whole of the garden."
Bedolla said 33 people had been injured by the blast and 45 houses damaged. Emergency services in the State of Mexico, which abuts the capital, said 16 vehicles were hit by the explosion.
President Enrique Pena Nieto expressed his condolences for the victims of the blast.
Mexican radio station Formato 21 said a family of four, including two children aged 11 and 6, were among the dead.
In January, a massive blast at the headquarters of state oil giant Pemex in downtown Mexico City claimed dozens of lives.
Media reports said the gas tanker did not belong to Pemex. The state oil company said it would help the company involved in rescue efforts.