It could take weeks to determine what caused a pair of explosions that ripped through a commercial and residential neighborhood here, knocking homes off their foundations, waking people sleeping miles away and sending residents fleeing.

Nearly 90 homes were damaged early Wednesday — about 25 are beyond repair — in the explosions, which were heard more than 20 miles away. Though 300 people were believed to have been home at the time, only 10 suffered injuries, all of them minor.

"The site is like an urban bomb, that has just completely devastated and destroyed not just the building in it, but the homes all around it," Sen. John Kerry said after touring the site late Wednesday. "I really think as tragic, obviously, as this is, particularly hurtful and difficult on the eve of Thanksgiving, there's a lot to be grateful for."

State and local officials said late Wednesday it would be at least Friday before residents in the most-damaged areas would be allowed to return home. Those staying in homes with less damage were given carbon monoxide detectors after inspectors found cracked or broken chimneys.

Federal and state emergency workers and the Red Cross were scheduled to staff an assessment center Friday and Saturday to help displaced residents.

The explosions occurred about 2:50 a.m. at CAI Inc., a manufacturer of solvents and inks. It sparked a 10-alarm fire that attracted a response from 30 cities and towns surrounding this town about 20 miles northeast of Boston.

The chemical plant, which was empty at the time, was leveled. A building next door housing a pizza shop and bakery was heavily damaged, and homes as far as neighboring Salem had broken windows.

"We were working and all of the sudden — boom — and everything gets dark," said Luis Ferreira, owner of the Danversport Bakery. He and three others, including his father-in-law, were working overnight baking bread and pies for holiday customers.

Ferreira said the bakery immediately went dark, and through the flour and dust, he and the others called out to each other.

"We had no idea what happened at the time. We just got out of there," said Ferreira, who suffered scrapes on his face and sported a bandage on his left temple.

Danvers Fire Chief James Tutko and State Fire Marshal Steve Coan said CAI had a commendable safety record. The U.S. Chemical Safety Board planned to assess the site Friday to determine if a full investigation was needed.

"All of us at CAI are shocked and devastated by this accident," CAI treasurer Paul Sartorelli said in a press release. "Our foremost concern is for the safety and well-being of our neighbors and employees."

Sartorelli said the company had an "impeccable" safety record and underwent major safety upgrades in 2001.

The company was inspected once, in 1990, as part of a planned visit by federal officials and no violations were found, according to Ted Fitzgerald, a spokesman for the Occupational Safety and Health Administration. The lack of inspections indicates a lack of complaints to OSHA, he said.

"A lot of people never knew it was there, that's how benign they were," said one neighbor, Jack Fratus.

The Danversport neighborhood along the river is among the oldest in the town, dating to the 1700s. Officials said it always has had a mixture of business and homes because it was developed before there were zoning laws.

Mike Nalipinski, on-scene coordinator for the Environmental Protection Agency, said preliminary tests showed low levels of toluene, a solvent, but nothing of significance.