MEXICO CITY - A pipeline exploded in central Mexico early Sunday as thieves tried to steal oil, killing at least 28 people and sending rivers of flaming crude through city streets.

Authorities said the explosion and resulting spill affected a three-mile radius, injuring at least 52 people and scorching more than 115 houses.

The principal explosion, followed by four smaller blasts, forced hundreds to flee the city of San Martin Texmelucan, 55 miles east of Mexico City.

"We saw rivers of fire in the streets," Valentin Meneses, interior secretary for the state of Puebla, where San Martin is situated, told Milenio Television.

Television images showed a scorched ghost town of houses, businesses, and trees blackened by the huge explosion and a black crude-like substance covering the streets.

Meneses said the explosion, which happened before dawn Sunday, was apparently caused by thieves trying to steal crude oil.

"They lost control because of the high pressure with which the fuel exits the pipeline," he said, adding that the oil began to flow down the city's streets and into a nearby river.

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. The area was without electricity or water.

Pemex has struggled with chronic theft, losing as much as 10 percent of all of its product.

Criminals tap remote pipelines, sometimes building pipelines of their own, to siphon off hundreds of millions of dollars' worth of oil each year, Pemex has said.

In 2009, the U.S. Justice Department said U.S. refineries bought millions of dollars worth of oil stolen from Mexican government pipelines and smuggled it across the border in illegal operations led by Mexican drug cartels expanding their reach.

Two Texas oil company officials were sentenced to probation in September for their roles in the sale of petroleum products stolen from Mexico.