Hamas leader Ismail Haniyeh said Saturday that Turkey has pledged to send large amounts of fuel to the Gaza Strip in an effort to end the crippling electricity shortage in the Palestinian enclave, which has sparked rare public protests.

Gaza’s Hamas rulers have detained hundreds of people in recent days in an effort to quell the protests that have rocked the Strip.

In a press release, Haniyeh said the deal for the emergency assistance from Ankara was struck after days of “extensive efforts” to end the power crisis.

The diesel fuel would help re-open Gaza’s sole power plant, which supplies electricity to some 2.2 million Palestinian residents of the Strip.

Haniyeh is also expected to meet with Qatari leaders in the coming days to discuss long-term solutions to the regular electricity shortages in Gaza.

Palestinian Hamas leader in Gaza, Ismail Haniyeh, gives a speech during a rally in Gaza City, Aug. 27, 2014. (AP/Khalil Hamra)

Palestinian Hamas leader in Gaza, Ismail Haniyeh, gives a speech during a rally in Gaza City, Aug. 27, 2014. (AP/Khalil Hamra)

The Palestinian territory is currently experiencing the worst electricity shortage in years, with power supplied to households only three to four hours a day in a cold winter.

A handful of deaths have been blamed on the cold weather in recent days.

In rare shows of dissent, Gaza residents in recent weeks have staged spontaneous demonstrations, including marching at night with torches to demand more electricity.

On Thursday, thousands of protesters in northern Gaza on Thursday marched to the local headquarters of the Hamas-run electricity company, in one of the largest unauthorized protests in the territory since the terrorist group seized power nearly a decade ago.

Palestinians take part in a protest against the ongoing electricity shortages in Gaza City on January 12, 2017. (AFP PHOTO / MOHAMMED ABED)

Palestinians take part in a protest against the ongoing electricity shortages in Gaza City on January 12, 2017. (AFP/Mohammed Abed)

Hamas has shown little tolerance for dissent, and it moved quickly to contain Thursday’s demonstration. Security forces dispersed the protesters violently, with shots fired in the air and a number of journalists beaten up.

Over the weekend Hamas detained hundred of protest organizers, but the actions seem to have had little success, with further protests planned.

On Wednesday, Hamas arrested a local comedian who made a viral video lamenting the power shortages during the cold winter season.

Life has become increasingly difficult for Gaza’s 2 million residents, who are squeezed into the tiny coastal territory. Hamas’s violent takeover a decade ago triggered a border blockade by Israel and Egypt that, among other things, sharply aggravated power shortages.

But the more immediate cause of the crisis appears to be the split between Hamas and the Palestinian Authority, the internationally recognized Palestinian leadership which governs the West Bank.

Hamas seized control of Gaza from Fatah, which dominates the PA, in a near civil war in 2007.

The two factions have been unable to form a unity government and have been in dispute over tax bills on fuel imports.

Another reason Gaza energy authorities have so little funding is unpaid bills.

Nearly 70 percent of households do not pay their electricity bills, either because of poverty or due to lack of collection, the UN estimates.