Videos of the incident show flames leaping roughly 50 feet into the air, as people attempted to carry bodies of the injured away from the conflagration.
"We are appalled by these events, by this tragedy, and we want, first of all, to offer our deepest condolences to the families of the victims, to inform the families of the victims that the entire government is with them," said López Obrador, rushed to the blast site in Hidalgo state, about 60 miles north of Mexico City.
In 2018, there were more than 13,000 illegal pipeline taps in Mexico, many of them apparently much like the intrusion that led to Friday's explosion: men with tools and blunt instruments hacking into the country's vast fuel network, followed by residents who arrive to collect the gasoline in buckets. Much of the stolen fuel is eventually sold on the black market.
The scale of the thefts has been huge. Last year, Mexico lost an average of 60,000 barrels of fuel to theft per day, according to Etellekt, a risk consulting firm that studies the thefts. The activity became increasingly controlled by organised crime, including drug cartels who entered the market, leading to a surge in violence in Mexican cities bisected by fuel pipelines.
When López Obrador announced his crackdown on the fuel thieves, nicknamed "huachicoleros," polls showed the majority of the country was behind him. He shut down many of the country's pipelines, attempting to starve the thieves of their supply, leading to a desperate gas shortage in much of the country. Even so, most Mexicans appeared to stand by his strategy.
Some analysts said the explosion showed the weakness of the government's campaign. The Hidalgo pipeline, like many others, remained functional, allowing oil thefts to continue.
"It shows that they lacked vigilance of the pipelines to avoid tragedies such as this one," said Ruben Salazar, the director of Etellekt.
Salazar said that fuel was leaking from the broken pipeline for two hours before it exploded, and no security forces had arrived until then.
"It shows the total inability of our security forces to prevent this kind of tragedy and the inability of the government to apply the law," he said.
Experts say these kind of thefts often attract hundreds of local residents, including children, who come with buckets of their own. The bodies of several children have been found at the scene of Friday's incident.
But López Obrador said the explosion would only reinforce his crackdown on huachicoleros.
"This unfortunately demonstrates that we must end this practice that led to the tragedy," he told reporters.
López Obrador referred to some of those involved not as hardened criminals but as "people without alternatives who were pushed to carry out these activities with all the risks involved."
The government recently announced it would send 10,000 troops to secure the country's pipelines. Many experts said that won't be enough.