Lowell, Mass. — An intense fire ravaged a three-story apartment building before dawn Thursday, killing four adults and three children, forcing tenants to jump or hand their children to safety, and leading to dramatic rescues from upper floors.

The victims in this former mill city about 25 miles northwest of Boston were all found in units on the top floor of the building, which had a liquor store on the ground floor and apartments on the upper floors, fire officials said. Nine people were hospitalized with injuries not considered life threatening.

The cause of the fire is being investigated. State Fire Marshal Stephen Coan said authorities are looking into witness reports that the blaze was preceded by an explosion that sounded like fireworks.

"I was shocked at how fast the fire moved from one end of the building to the other," he said.

Authorities say 48 people lived in the building, which sustained heavy damage. The roof entirely burned away, with the outer walls charred and the siding melted. Firefighters had to evacuate at one point as the roof gave way.

Neighbor Sarin Chun said she awoke to screams and saw someone hand a child out a window to another person on the street.

Witnesses said tenants jumped out of windows. Several people had to be rescued from upper floors.

A police officer on routine patrol was the first to report the fire, while several tenants ran about 100 yards down the street to a fire station to sound the alarm, Fire Chief Edward Pitta said. But the building was fully involved by the time firefighters arrived.

Middlesex District Attorney Marian Ryan said she is "deeply concerned" by reports from witnesses that no fire alarms sounded. The building did not have a sprinkler system but was not required to, Pitta said. It did have an alarm system, and whether that was working will be part of the investigation.

The Red Cross is assisting displaced tenants, and the city is accepting donations of clothing and other essentials, Elliott said. A relief fund has been set up at the Jeanne D'Arc Credit Union in the city.

A chaplain for the fire department, Rev. Paul Clifford, said chaplains were offering what comfort they could to people who escaped.