A fire set off by stored gasoline in a residential building killed 21 people Thursday evening in a refugee camp in the northern Gaza Strip, the territory's Hamas rulers said, in one of the deadliest incidents in recent years outside the violence stemming from the Israeli-Palestinian conflict.

The blaze erupted on the third floor of a three-story building in the crowded Jabaliya camp, according to the Palestinian militant group Hamas. No one inside the house survived.

The Civil Defense in Gaza, which is run by Hamas, attributed the cause of the fire to gasoline that was being stored in the building. It was not immediately clear how the gasoline ignited. Officials said an investigation was underway.

Flames were seen spewing out of the windows of the burning floor as hundreds of people gathered outside on the street, waiting for fire trucks and ambulances.

ISRAELI TROOPS RAID GUNMEN'S HIDEOUT; 5 PALESTINIANS KILLED

Gaza, ruled by Hamas and under a crippling Israeli-Egyptian blockade, faces a severe energy crisis. People often store cooking gas, diesel and gasoline in homes in preparation for winter. House fires have previously been caused by candles and gas leaks.

Palestinian President Mahmoud Abbas offered condolences to the families of the dead and declared Friday a day of mourning.

Gaza fire

Hamas police officers secure the scene of burned apartment on the third floor of a three-story building in Jebaliya refugee camp, northern Gaza Strip, on Nov. 17, 2022. (AP Photo/Adel Hana)

Tor Wennesland, the United Nations’ Middle East peace envoy, expressed "heartfelt condolences to the bereaved families, relatives and friends of those who died in the accident; the Government, and the Palestinian people."

Hussein Al-Sheikh, a senior Palestinian Authority official, called on Israel to open its border crossing with Gaza to allow for the evacuation of those injured who need advanced medical care to Palestinian hospitals in the West Bank and Jerusalem. It was later confirmed that all in the house had died.

CLICK HERE TO GET THE FOX NEWS APP

COGAT, the Israeli body controlling the Erez Crossing with the Gaza Strip, did not comment.

But Israel’s Defense Minister Benny Gantz sent his condolences to the Palestinians, writing on Twitter that "we have offered our assistance in evacuating injured civilians to hospitals via COGAT. The State of Israel is prepared to provide life-saving, medical aid to Gaza residents."