With kisses on the cheek in a gleaming hall of Egypt's intelligence services, leaders of rival Palestinian groups Hamas and Fatah reached an agreement for Hamas to hand over control of the Gaza Strip to the Fatah-led Palestinian Authority.
The deal is just an early step in a longer process that could end a decade-long split that has nearly paralyzed Palestinian political leadership and increased the misery for Gazans in need of jobs and aid.
According to the agreement, the Western-backed Palestinian Authority will resume all governing responsibilities in Gaza no later than Dec. 1.
Attempts at reconciliation in recent years fell apart. If this deal succeeds, the Palestinian territories of the West Bank and Gaza will be reunited under one leadership for the first time since the Islamist militant group Hamas wrested control of the territory 10 years ago.
"Our house is one. Our suffering is one. Our fate is one. Our future is one," senior Hamas leader Saleh al-Arouri said in televised remarks Thursday after two days of marathon talks mediated by Egypt.
Fatah officials said the two sides agreed that the Palestinian Authority would take over responsibility for Gaza's border crossings no later than Nov. 1 and that full governing responsibilities would be handed over to the Palestinian Authority by the beginning of December.
In 2007, when the two groups could not agree on sharing power, Hamas drove Fatah leaders out of Gaza and wrested control of the seaside territory, leaving Palestinian Authority President Mahmoud Abbas in control only of parts of the West Bank.
With Hamas in control, conditions in Gaza deteriorated. Israel and Egypt imposed a blockade on the territory, severely restricting Palestinians from leaving the territory and goods from entering. Hamas and Israel fought three wars over the past decade. Unemployment is high, and electricity and clean water are scarce. Hamas has said it hopes that by giving back power to the Palestinian Authority, life in Gaza can improve.
According to the text of the agreement signed by both parties, Egypt mediated the deal in order to "achieve Palestinian unity in order to ... establish an independent Palestinian state" in Gaza and the Israel-occupied West Bank.
Palestinian media reported that the two sides agreed to form a committee to solve, within four months, one very local problem that has dogged previous attempts at reconciliation: what to do about Hamas bureaucrats who will be out of a job when the Palestinian Authority resumes its rule in Gaza. The reports also said the Palestinian Authority would seek to merge Hamas' police officers in Gaza with the Palestinian security services.
But one central issue has yet to be discussed: the fate of Hamas' militant wing and cache of rockets and weapons. Abbas has said he would not take over Gaza until Hamas gave up its weapons. It is unclear whether that unresolved issue will delay Abbas' government's return to Gaza.
Israeli Prime Minister Benjamin Netanyahu wrote on Facebook that any reconciliation deal must make Hamas disarm and "end its war to destroy Israel." And he said a reconciliation deal makes peace harder to achieve.
The U.S. says it wants the Palestinian Authority to take control of Gaza again. And the Palestinian Authority is hoping that reconciliation will allow the Palestinian territories to have a unified voice to press Israel for an independent state.