A natural gas tanker truck lost control, hit a center divider and exploded on a highway lined by homes in the Mexico City suburb of Ecatepec early Tuesday, killing at least 20 people and injuring nearly three dozen, authorities said.

Officials at the Citizen Safety Department of Mexico State, which surrounds the capital, did not rule out the possibility the death toll could rise as emergency workers continued sifting through the charred remains of vehicles and homes built near the highway on the northern edge of the metropolis.

Residents pitched in to rescue people from the wreckage of the 5:30 a.m. explosion, crushed and burned cars and shattered homes. Television footage showed plumes of flame shooting out of homes in the pre-dawn darkness.

A huge piece of the truck’s gas tank was blown 50 yards by the blast, landing atop the wall of a house and cars parked outside. A number of pigs and other farm animals that were kept on patios were killed.

“It was thunderous sound. I thought we were all going to die,” said Rita Enriquez, 42, a woman who lives nearby. “When we ran out, we saw a car on fire and flames everywhere. Smoke was pouring all over the freeway.”

Mario Lopez, 43, a mechanic, lives in the house hit by the tank and managed to escape with his three sons after being awakened by the blast.

“All the windows broke to the inside. We got down and left crawling,” said Lopez, who lost a brother, a sister, three nephews and a sister-in-law who all lived in separate units of the three-story home. He said 12 people in all died in the house. “Everything was in flames,” he said.

Enriquez said five of her relatives were gravely injured in their concrete slab home along the road, though she had no other details as she waited for word outside Magdalena Las Salinas Hospital in Mexico City.

The pre-dawn disaster exposed two recurrent public safety issues in Mexico: extremely heavy trucks that are frequently involved in serious accidents, and the construction of improvised homes just feet away from major highways.

Some of the cinderblock homes hit by the huge explosion were just steps from the busy, eight-lane highway. Other homes were mere shacks, built of sheet tin.

Lopez said the highway recently had been widened, bringing traffic perilously closer to their dwellings.

“They never thought a car could hit them or an explosion of this magnitude,” said Maribel Juarez, the cousin of another family killed in the explosion. “Now we have to bury their coffins and our family members are never going to return.”

The driver, Juan Olivares, 36, was heading south from the city of Pachuca to Mexico City in a tractor that was hauling two gas tanks on tandem trailers, said Jose Luis Cervantes, an assistant state prosecutor. He said the vehicle belonged to the Termogas company.

Cervantes said the tractor hit a center divider and broke apart, with one tank flying into a house and exploding, killing 15 people, and another part of a tank hitting a separate house, killing four. He did not say where the 20th person died.

The driver, who was under detention while being treated at a hospital, could face manslaughter and property damage charges, the prosecutor said.

“We just pulled burned people, and put out the fire in the houses, but we don’t really know what happened,” said Rogelio Martinez, a resident.

State security officials counted 33 injured. More than 20 had been hospitalized, eight of them in grave condition, Health Secretary Cesar Gomez said.