Qatar has said it is sending $480m (£370m) to Palestinians in the West Bank and the Gaza Strip after a ceasefire deal ended the deadliest fighting between Israel and Palestinian militants since 2014.

Qatar’s foreign ministry said $300m would go towards supporting health and education programmes of the Palestinian Authority, while $180m would go toward urgent humanitarian relief, UN programmes and providing electricity.

The recent two-day outbreak of violence killed 25 people in Gaza, both militants and civilians, and four civilians in Israel.

The Hamas spokesman Hazem Qassem said Egyptian mediators, along with officials from Qatar and the UN, helped broker the ceasefire deal.

The deal is believed to include a number of economic aid and development programmes in Gaza, including providing additional electricity and creating temporary jobs in a territory where unemployment has risen to more than 50%. The Hamas-ruled Gaza Strip suffers from chronic electricity shortages.

The small fossil fuel-rich nation of Qatar has become a major donor to Palestinians, who have been divided between two rival governments since 2007, when Hamas drove forces from the internationally recognised Palestinian Authority out of Gaza. Hamas has ruled Gaza since then, with the Palestinian Authority administering autonomous zones in the Israeli-occupied West Bank.

This marks the first time in recent years that Qatar has funded the Palestinian Authority directly. Before, its money has gone to Gaza, where it opened a hospital last month.

The US and EU classify Hamas as a terrorist group. Although Qatar does not give money directly to Hamas, its support since 2012, totalling $755m, has been a vital lifeline for the cash-strapped group, relieving it from having to fund civilian and infrastructure projects.

Omar Shaban, a Gaza economist, said the latest funding was extraordinary. “This decision boosts Qatar’s role in the coming phase and makes it as acceptable in Ramallah [in the West Bank] as it is in Gaza,” he wrote on Facebook.

Both Palestinian governments are in deep financial distress. The Palestinian Authority has been hit hard by cuts to the tune of hundreds of millions of dollars in US aid, as well as a dispute with Israel over tax transfers.

Israel has begun to withhold money from these transfers that it says the Palestinians give to families of attackers who have been jailed or killed fighting Israeli forces.

Israel says the money rewards violence. Palestinians say the payments are social welfare to families affected by conflict, and they have refused to accept the tax transfers unless the funding is fully restored.

The aid cuts and refusal to accept partial tax transfers have plunged the Palestinian Authority into a deep crisis, leaving it able to pay its workers only half of their salaries.

In the West Bank, the Palestinian president, Mahmoud Abbas, thanked Qatar and said the aid would “help the Palestinian people overcome some of their hardships, face the challenges and strengthen their steadfastness on their land”.

In Gaza, the economy has been ravaged by an Israeli-Egyptian blockade, years of fighting with Israel and Hamas’s isolation and mismanagement. Cuts in aid from Abbas’s government, as well as US cuts in funding for UN programmes, have also hurt the coastal strip’s population.

The Hamas leader, Ismail Haniyeh, welcomed the Qatari aid and thanked the Gulf state’s leader. “This honourable decision is a continuation of the unwavering Qatari stances that support the Palestinian people politically and financially, in addition to defending the Palestinian rights at international platforms,” he said.