GAZA/CAIRO (Reuters) - Rival Palestinian factions Hamas and Fatah signed a reconciliation deal on Thursday after Hamas agreed to hand over administrative control of Gaza, including the key Rafah border crossing, a decade after seizing the enclave in a civil war.

The deal brokered by Egypt bridges a bitter gulf between the Western-backed mainstream Fatah party of Palestinian President Mahmoud Abbas and Hamas, an Islamist movement designated as a terrorist group by Western countries and Israel.

Palestinian unity could also bolster Abbas’s hand in any revival of talks on a Palestinian state in Israeli-occupied territory. Internal Palestinian strife has been a major obstacle to peacemaking, with Hamas having fought three wars with Israel since 2008 and continuing to call for its destruction.

Hamas’s agreement to transfer administrative powers in Gaza to a Fatah-backed government marked a major reversal, prompted partly by its fears of financial and political isolation after its main patron and donor, Qatar, plunged in June into a major diplomatic dispute with key allies like Saudi Arabia. They accuse Qatar of supporting Islamist militants, which it denies.

Israel viewed the Palestinian accord warily, saying it must abide by previous international agreements and terms set out by the Quartet of Middle East peace mediators - including the recognition of Israel and the disarming of Hamas.

“Israel will examine developments in the field and act accordingly,” said a statement from Prime Minister Benjamin Netanyahu’s office.

Thousands of Palestinians took to the streets across Gaza on Thursday in celebration of the unity pact, with loudspeakers on open cars blasting national songs, youths dancing and hugging and many waving Palestine and Egyptian flags.

Egypt helped mediate several previous attempts to reconcile the two movements and form a power-sharing unity government in Gaza and the West Bank, where Abbas and the Fatah-led Palestinian Authority (PA) are based.

Hamas and Fatah agreed in 2014 to form a national reconciliation government, but the deal soon dissipated in mutual recriminations with Hamas continuing to dominate Gaza.

Slideshow ( 16 images )

“The legitimate government, the government of consensus, will return according to its responsibilities and according to the law,” Fatah delegation chief Azzam Al-Ahmed said at the signing ceremony in Cairo.

He said the unity government would “run all institutions without exception,” including all border crossings with Israel and in Rafah, Gaza’s only access point with Egypt.

The agreement calls for Abbas’s presidential guard to assume responsibility of the Rafah crossing on Nov. 1, and for the full handover of administrative control of Gaza to the unity government to be completed by Dec. 1.

Analysts said the deal is more likely to stick than earlier ones, given Hamas’s growing isolation and realization of how hard Gaza, its economy hobbled by border blockades and infrastructure shattered by wars with Israel, was to govern and rebuild.

Deeper Egyptian involvement, believed to have been backed by Saudi Arabia and other Arab states, also helped cement the deal.

“We in Hamas are determined and are serious this time and just like all other times ... We have dissolved the administrative committee (shadow government)... We have opened the door to reaching this reconciliation,” Saleh Arouri, the head of Hamas negotiators in Cairo, said after the signing ceremony.

Delegations from the two rivals have been in talks in Cairo this week to work out the details of the administrative handover, including security in Gaza and at border crossings.

Slideshow ( 16 images )

RAFAH CROSSING

Key was the Rafah crossing, once the gateway to the world for the 2 million people packed into the small impoverished territory. Fatah said it should be run by the presidential guards, supervised by the European Union border agency, EUBAM, instead of the Hamas-linked employees now deployed.

“EUBAM Rafah maintains readiness to redeploy to the Rafah crossing point when the security and political situations will allow,” said Mohammad Al-Saadi, press officer for the EU Coordinating Office for Palestinian Police Support.

Any decision on EUBAM deployment would be taken in conjunction with the Palestinian Authority and Israel’s government, he said in a statement.

Some 3,000 Fatah security officers are to join the Gaza police force. But Hamas would remain the most powerful armed Palestinian faction, with around 25,000 well-armed militants.

Both rivals hope the deal’s proposed deployment of security personnel from the PA to Gaza’s borders will encourage Egypt and Israel to lift tight restrictions at frontier crossings - a step urgently needed to help Gaza revive a war-shattered economy.

Another major issue in talks on the deal was the fate of 40,000 to 50,000 employees Hamas has hired in Gaza since 2007, a thorny point that helped crash the 2014 unity accord.

Under the deal, these employees will receive 50 percent of what their PA salary would be - or equivalent to what they are paid now by Hamas - pending vetting of their professional qualifications.

Hamas and Fatah are also debating a potential date for presidential and legislative elections and reforms of the Palestine Liberation Organization, which is in charge of long-stalled peace efforts with Israel.

The last Palestinian legislative election was in 2006, when Hamas scored a surprise victory. That sparked the political rupture between Hamas and Fatah, which eventually led to their short civil war in Gaza.