An unattended electric space heater in a bodega is being blamed for a three-alarm fire early-Wednesday morning in Brooklyn that resulted in the deaths of two women, according to the city fire department.

The flames broke out around 1:28 a.m. in a building located at 964 Belmont Avenue in East New York.

Two women, who were on the building's third floor, were taken to Brookdale Hospital, where they were pronounced dead.

The women did have a smoke alarm, but fire officials confirmed that it was not working at the time.

Fire department officials said that people on the second floor we able to escape because their fire alarms were working properly.

The Red Cross is providing assistance to 18 families.