Hailed as the end of a "dark division," long-time Palestinian rivals Fatah and Hamas have reached a reconciliation agreement after a decade of failed attempts and often bitter acrimony, according to statements from the factions.
Hamas media spokesman Taher al-Nouno posted on social media that an agreement had been reached early Thursday.
"The head of the Hamas political bureau, Ismail Haniyeh, announced that an agreement was reached at dawn today between Fatah and Hamas," al-Nouno posted on his Facebook page.
Fatah Central Committee member Zakaria al-Agha posted on Facebook: "The dark division has ended. Thank God and our congratulations to our Palestinian people everywhere."
Fatah spokesman Usama Qawasmi confirmed a comprehensive reconciliation agreement had been reached between Fatah and Hamas "under Egyptian blessing."
The two groups had started reconciliation talks, mediated by the Egyptian government, in Cairo on Tuesday.
The direct talks followed a round of Egyptian-led indirect talks in Cairo in mid-September.
Fatah, the party of Palestinian Authority President Mahmoud Abbas, governs the West Bank; Hamas runs Gaza.
Neither Fatah nor Hamas have released details of the reconciliation, leaving an open question on how this agreement addresses points where previous reconciliation attempts are believed to have fallen apart.
The Palestinian Authority had demanded, for example, that Hamas disband its military wing and relinquish security control to the Palestinian Authority, a point Hamas had refused to concede.
Control of Gaza's borders had also previously been an impassable disagreement between Fatah and Hamas.
One day before the latest round of talks began, Palestinian President Mahmoud Abbas told a Fatah Revolutionary Council meeting that reconciliation was a "priority that we seek to achieve by all means possible."
He said the two sides were going to Cairo "resolved and determined to make it happen and achieve concrete results in that respect."
Q&A: What is Hamas?
Ray of hope
The detente between Fatah and the Islamist Hamas could mean the end of a rift between the West Bank and Gaza that started in 2007, after Hamas violently evicted the Palestinian Authority from the coastal enclave.
Earlier this month, Palestinian Prime Minister Rami Hamdallah, entering Gaza for the first time in two years, promised to heal divisions and improve the lives of Gazans, who have been living under an Israeli-Egyptian imposed blockade and failing infrastructure damaged after several wars with Israel.
Two weeks earlier, Hamas had announced it would disband its Gaza "administrative committee"-- established earlier this year and seen as a direct challenge to the Palestinian Authority, allowing a Palestinian unity government to work in its place and move toward general elections.
The talks had their roots in a 2011 meeting aimed at reconciliation, also mediated by Cairo.
Israel has not yet responded to Thursday's announcement by Fatah and Hamas.
However, the biggest single issue for Israel will likely be Hamas' weapons. As long as Hamas holds on to its arms, Israel is unlikely to regard Palestinian reconciliation as a game-changer in terms of Israeli policy on peace talks.
This is also true for Hamas' network of tunnels, running from Gaza into southern Israel and into Egypt. Israel will want to know they have been destroyed and that the Palestinian Authority is properly in control of the Gaza border.
A third major issue is Hamas' commitment to the destruction of Israel. Unless Hamas recognizes Israel's right to exist, Israeli politicians will not regard reconciliation as making a difference in terms of peace negotiations.
Prime Minister Benjamin Netanyahu set out the Israeli position clearly last week in remarks following Hamdallah's visit to Gaza, but did not dismiss the reconciliation efforts outright.
"We expect everyone who talks about a peace process to recognize the State of Israel and, of course, to recognize a Jewish state and we are not prepared to accept bogus reconciliations in which the Palestinian side apparently reconciles at the expense of our existence," he said.
"Whoever wants to make such a reconciliation, our understanding is very clear: Recognize the State of Israel, disband the Hamas military arm, sever the connection with Iran, which calls for our destruction, and so on and so forth. Even these very clear things must be clearly stated."
Netanyahu's response, less dismissive than regards previous efforts, likely reflects Israel's relations with Egypt and with the United States.
Egypt is a key partner for Israel following the peace deal signed between the two states almost 40 years ago. The fact that Egyptian President Abdel Fattah el-Sisi has played such a central role in advancing this reconciliation makes it difficult for Netanyahu to simply push it away.
The Americans, too, have given the reconciliation efforts their blessing.
In a statement released during Hamdallah's Gaza trip last week, White House Special Representative Jason Greenblatt said the United States welcomed "efforts to create the conditions for the Palestinian Authority to fully assume its responsibilities in Gaza" and would be watching developments closely while trying to improve the humanitarian situation in Gaza.
"The United States stresses that any Palestinian government must unambiguously and explicitly commit to non-violence, recognition of the State of Israel, acceptance of previous agreements and obligations between the parties, and peaceful negotiations," Greenblatt said.
Hamas' arms are as big a concern for Abbas as they are for Netanyahu.
Last week, Abbas gave an interview to Egyptian television in which he said he did not want Hamas in Gaza to replicate Hezbollah's role in Lebanon; in other words, controlling the military and security environment, while the Palestinian Authority looks after political affairs and civil society.
Gaza crisis looming
The push for reunification comes as Gaza faces a mounting humanitarian crisis.
The United Nations has warned the coastal enclave may be unlivable by 2020. Electricity is available for only a few hours a day.
Barely one in 10 residents has access to safe drinking water through the public water network, and the United Nations projects that Gaza's aquifer may become unusable at the end this year.