More than 30 people were injured when an explosion rocked a neighbourhood near San Francisco, setting at least 20 homes ablaze and sending residents fleeing in panic.

Local utility officials said they believe the source of the blast was a large natural gas pipe that ran underground through San Bruno, where some houses in several blocks near San Francisco International Airport were reduced to smouldering ruins and authorities conducted emergency evacuations.

More than 30 people were treated at a local Kaiser Permanente hospital in San Bruno, while others were rushed to burn units at other medical facilities, according to hospital spokesperson Karl Sonkin.

Workers from the San Francisco coroner's office arrived at the scene of the disaster at about 9pm (0400 GMT on Friday) indicating people may have died in the blast and subsequent fire.

"This is really a tragedy," Sonkin said. "We are caring for people as best we can."

Several fire crews were on the scene attempting to douse what witnesses described as a massive "ball of fire".

"I heard a sound like a low flying plane, then all of a sudden the house shook," said Tina DiIoia, who was with her baby in their condominium in the town of San Bruno, just south of San Francisco, when the explosion occurred about a half-mile away.

"Then there was another explosion. I went outside and there was debris falling from the air."

Flames had spread to more than 20 homes and people were being evacuated from areas downwind of the inferno.

"It looks like the entire mountainside is burning," DiIoia said as she and her husband took their baby and evacuated the town.

The blast so close to the busy airport had initially sparked fears of terrorism, ahead of Saturday's ninth anniversary of the 11 September 2001 attacks, but there was no information suggesting a link.