A chemical plant exploded early Wednesday, sparking a massive fire and blowing debris for blocks that damaged nearly 90 homes but caused only minor injuries, officials said.

"It looks like a war zone," Danvers Fire Chief James P. Tutko said after surveying the area by helicopter. "It's just — it's devastating."

The explosion hit just before 3 a.m. and could be felt miles from the CAI Inc. plant, about 20 miles north of Boston. About 300 people were in the surrounding neighborhood at the time, but police who went door-to-door throughout the area found fewer than a dozen had been injured, and none was in serious condition, Tutko said.

"Somebody out there likes us," Tutko said, explaining the lack of more serious injuries.

The explosion ripped rooftops from homes, and buildings were shaken off their foundations. Nearly all of the about 90 homes in the surrounding neighborhood were damaged, including 15 to 25 that probably can't be saved, Tutko said. Residents, including those in a nursing home a facility for the deaf, were evacuated to shelters set up at area schools.

Nancy Chick, who lives in a second-floor condo across the Crane River, said the shock bowed her windows inward and pulled her curtains halfway out before the windows returned to their normal position in the frames.

Afterward, the curtains hung from their rod and flapped outside her window, even though it was closed.

"I never saw anything like it," said Chick, 66. "All the pressure must have blown it in and then sucked it out."

It was too early to speculate on a cause of the blast, Tutko said. Several small structural fires still burned more than six hours after the explosion.

"I was in bed and then next thing I knew, I was on my feet," said Paul O'Donnell, 44. "I saw the flames and grabbed my clothes. My first thought was that an airplane crashed, but then I thought it was too early for that."

Fred Grenier, 25, was asleep in a second-floor bedroom about 200 yards from the plant when it exploded.

"The windows came caving in. The (air conditioner) fell right on me," he said. "There were windows gone, doors gone, vinyl siding off the houses."

"Everyone was out in the street making sure everybody's all right," he said. "When you went out on the front porch, you could feel the heat."

State Police Maj. Kevin Kelly said he felt the explosion at his home 21 miles away. Some neighbors mistook it for an earthquake, while one caller to WBZ-AM said he looked out his window and saw "the picture of London during the blitz — that silhouette."

Utilities were out across the neighborhood surrounding privately-owned CAI. Town officials canceled school for the day, and some residents who tried to drive out found their cars were stuck because their garage doors had been blown off their rails.

CAI Inc., a privately-owned company, makes solvents and inks and has five to nine employees in Danvers. A person who answered the phone at CAI's Georgetown headquarters Wednesday morning declined to comment.

Mike Nalipinski, on-scene coordinator for Environmental Protection Agency, said preliminary tests showed a low level of toluene, a solvent, but no significant dangers.

Runoff from water used by fire fighters left a purple sheen on the nearby river, and water tests were being conducted, but Nalipinski said it was not a drinking water supply and the chemical evaporates quickly.

There is an Eastern Propane facility close to the CAI plant, but company spokesman Jeff Taylor said its tanks were secure, though the property suffered some minor damage.