A tanker truck carrying about 9,400 gallons of gasoline overturned and caught fire early Wednesday, spilling the blazing fuel through streets and destroying at least two multifamily homes and as many as 40 cars.

Residents of nearby homes were evacuated, and there were no reports of any deaths or serious injuries.

The accident occurred shortly after 1:30 a.m. at a rotary connecting Routes 16 and 99, fire officials said. State Police Maj. Kevin Kelly said the driver of the tanker lost control and his vehicle overturned and struck a guardrail.

Click here to read more from MyFoxBoston.com.

John Malone, who lived in one of the buildings that was destroyed, said he saw flames outside his window and the fuel flowing down the street when his girlfriend woke him.

"It was like a river," he said, adding that he saw cars exploding as the fuel and flames reached them. "As the river went, the fire went with it."

The tanker's driver, Chad LaFrance, 30, of Dover, N.H., was cited for speeding, but the investigation was ongoing. LaFrance was not injured.

By midmorning, firefighters were still pouring water on one of the ruined three-story homes in the community of 38,000, just north of Boston. Their efforts initially were hampered by frozen hydrants and ice as the temperature was well below the freezing mark.

"In consideration of everything the firefighters at the scene had to deal with, I think it's a miracle that we haven't seen any serious injuries," Fire Chief David Butler said at a news conference.

Forty-seven residents were evacuated from buildings near the fire, including the two that were destroyed. Also evacuated were 84 residents of an elderly housing complex that was threatened but did not burn, Butler said. Evacuees were taken to a nearby armory for shelter.

"The alarm went off and we all took off out of there," said Francis Mahoney, who lives at the elderly housing complex and was standing outside wearing sandals, socks and a flannel coat several hours after the fire began. "All we saw was the flames in front. We had to get out of there."

Dylan Constantine, 32, said he was half asleep watching TV when an explosion that "sounded like a shotgun blast" jolted him wide awake. He roused his roommates and they took off outside, where they had to jump through a wall of flames as gasoline flowed past his house. Cars were exploding one after another.

"We were scared the whole street was going to go up," said Constantine, whose house was spared.

The truck driver works for Abenaqui Carriers, of North Hampton, N.H., state police said. The company did not immediately respond to a call seeking comment.

New Hampshire records show three speeding violations from 2000 to 2002 involving LaFrance's personal vehicle, as well as two failures to have his vehicle inspected. There also was a violation involving an unregistered vehicle.

Federal Motor Carrier Safety Administration records for P.S. Marston Associates, LLC -- the owner of Abenaqui -- show the company's 83 commercial trucks and 105 drivers have been involved in four accidents in New England over the past two-and-a-half years. There were injuries in one accident but no fatalities.