San Martin Texmelucan: A massive oil pipeline explosion lay waste to parts of a central Mexican city on Sunday, incinerating people, cars, houses and trees as gushing crude turned streets into flaming rivers.

At least 28 people were killed, 13 of them children, in a disaster authorities blamed on oil thieves.

The blast in San Martin Texmelucan, initally estimated to have affected 5,000 residents in a five-kilometre radius, scorched homes and cars and left metal and pavement twisted and in some cases burned to ash in the intense heat.

Relatives sobbed as firefighters pulled charred bodies from the incinerated homes, some of the remains barely more than piles of ashes and bones.

Officials identified all but four of the dead by Sunday night. Although they released some names, they didn't say if they were all residents of the area or possible suspects.

Housewife Zoyla Perez Cortes, 27, said she awoke about 5:30am to a strange, overpowering smell, like gasoline. Minutes later, her street looked like it was flowing in tar and then erupted in flames.

Her husband knocked down a wall allowing them to escape out the back of their two-storey, cement-brick home with their three children.

Her brother-in-law is being treated for burns in a hospital, but she didn't know the fate of his wife and two children.

"It was like we were living in an inferno," she said, her eyes red from crying. "Everything was covered in smoke."

Laura Gurza, chief of the federal Civil Protection emergency response agency, said that in addition to the 28 deaths, at least 52 people were hurt and 84 remained in a shelter late on Sunday after fleeing San Martin. More than 115 homes were scorched, 32 of them destroyed.

The explosion was apparently caused by thieves trying to steal crude oil, said Valentin Meneses, interior secretary for the state of Puebla, where San Martin is located.

Investigators found a hole in the pipeline and equipment for extracting crude, Gurza said.

"They lost control because of the high pressure with which the fuel exits the pipeline," he said.

The oil flowed more than one kilometre down a city street before diverting into a river. At some point a spark of unknown origin caused both to erupt in flames.

Several bodies were found in cars near the location of the leak, but authorities didn't know if the dead were involved in the theft or just there by coincidence.

Many of the buildings destroyed were humble cement homes. Gurza said people are not permitted to live near oil pipelines, but Jose Luis Chavez, 58, who lives 10 blocks from the explosion, said residents had been there for some time.

Chavez said he heard at least two loud booms and saw flames leap more than 10 metres in the air. It was as if a bomb had exploded underground, he added.

President Felipe Calderon arrived late on Sunday afternoon to talk with displaced people in a shelter, visit the injured in a hospital and survey damage on the main street where the fuel exploded.

Earlier, he expressed condolences to the families of the dead and his support for those injured and affected. He said the federal government would give its full support in investigating who was responsible and bringing them to justice.

No one had been detained.

Interior Minister Francisco Blake Mora mobilised several federal ministries to help victims with medical care, shelter and recovering their lost homes and property.

The state-owned oil company Petroleos Mexicanos, or Pemex, said in a statement that it had shut down the pipeline. Government authorities said the fire was under control by midday. Some areas were without electricity or water.