(CNN) -- A fire raced through a motel on the New Jersey shore early Friday, killing four people and injuring at least 8 others, authorities said.
While authorities said earlier they were trying to determine the whereabouts of about 10 others, all remaining occupants were accounted for by Friday afternoon, fire officials said.
Volunteer firefighters found the second floor of the Mariner's Cove Motor Inn in Point Pleasant Beach engulfed in flames shortly after they were called at 5:33 a.m., borough fire chief A.J. Fox said.
About 40 people were staying at the motel, and the cause of the blaze wasn't immediately clear, prosecutor Joseph Coronato said.
Most of the people who escaped had left the building by the time firefighters arrived, but the firefighters rescued one woman who'd sought refuge in a shower under running water, Fox said.
"One of our firefighters noticed her in a window," Fox said. Rescuers broke the window, sprayed water on flames overhead, grabbed the woman and brought her out through the window frame, he said.
"She saved her own life, being in the shower (with the) water running," Fox said. The woman was believed to be one of the injured taken to a hospital; her condition wasn't known, Coronato said.
The names of the dead and the injured weren't immediately released. Coronato's office initially said three of the injured were critically hurt, but the prosecutor didn't provide any information on conditions at a news conference later Friday morning.
They suffered injuries such as burns and smoke inhalation. One sheriff's officer had broken bones, Coronato said without elaborating.
The fire was under control by 7:04 a.m., Coronato said. Authorities sifted through debris after the building was deemed safe to enter, Coronato's spokesman, Al Della Fave, said.
Firefighters searched the partially collapsed structure for survivors, CNN affiliate WABC reported.
Coronato said a task force including members of his office and police arson investigators will look into the fire's cause.