Claudia Dominguez, spokeswoman for the city's civil defense agency, confirmed the deaths and said she expected an updated toll soon.
She said she could not confirm the report by the local borough chief, Adrian Rubalcava, that seven had died Rescuers continued digging through the rubble even as smoke rose from remaining fires.
Mayor Miguel Angel Mancera earlier told the Televisa network that at least 54 people were injured, 22 of them children. Most of the injuries were relatively minor, he said, many caused by flying glass.
The explosion sent a column of smoke billowing over the area on the western edge of Mexico's capital and television images showed much of the hospital collapsed, with firefighters trying to extinguish fires.
Also Read
Mancera said the heaviest damage was near the hospital's loading dock.
Mancera said the blast apparently was caused by a leak in the hose carrying gas from the truck to the hospital, which is operated by the city.
"The truck must have had some failure, the hose and that's what caused the explosion," Mancera said. He said that fire continued burning because firefighters recommended that they allow the truck's remaining gas to burn off. He said there was no risk of another explosion.
Garcia ran toward the hospital where the truck had exploded and was told it had been connecting to the kitchen when the explosion occurred.
Garcia and others entered the hospital and made their way to the nursery. "Fortunately, we were able to get eight babies out," he said.
Rubalcava said the injured were being taken to a nearby hospital, but the area had insufficient ambulances.
Rafael Gonzalez of the Red Cross said one 38-year-old woman was stable in their hospital in Polanco while a 27-year-old man who had initially been taken there was transferred again with burns over 90 percent of his body.