Rival Palestinian groups Hamas and Fatah have reached a preliminary, partial agreement that could pave the way for President Mahmoud Abbas to resume governing the Gaza Strip a decade after Hamas overran the territory, officials said.
Details of the deal were announced at a news conference in Cairo, where the negotiators were meeting.
Hamas leader Ismail Haniyeh said in a statement that the deal was reached under "generous Egyptian auspices".
A senior Palestinian official said Mr Abbas, the leader of Fatah, might visit Gaza in the coming weeks, depending on the successful implementation of the agreement.
The Western-backed Mr Abbas has not set foot in Gaza since 2007, when the Islamic militant Hamas, his main ideological rival, seized the territory after days of factional street battles.
The Hamas takeover, which came a year after the group defeated Fatah in Palestinian parliamentary elections, left Mr Abbas with autonomous enclaves in the Israeli-occupied West Bank.
Over the past decade, each side deepened control over its territory, making it increasingly difficult to forge compromises, and repeated attempts at reconciliation failed.
Under the emerging agreement, Hamas would hand over responsibilities of governing Gaza to the West Bank-based government of prime minister Rami Hamdallah.
Azzam al-Ahmad, head of the Fatah delegation, said Mr Abbas' Palestinian Authority would assume control of the crossing points between Gaza and Israel by November 1.
He said Mr Abbas' presidential guard would assume control of the Rafah crossing between Gaza and Egypt, but did not specify a timetable.
Egypt has kept the Rafah border crossing closed for most of the last decade.
Before the Hamas takeover, Mr Abbas' presidential guard administered the crossing under EU monitoring.
"The Rafah crossing needs some measures to improve and renovate the buildings in a way that is worthy of Egypt and the Palestinian people so as it can operate smoothly," Mr al-Ahmad said during the announcement of the deal.
A senior Hamas official said both sides agreed that European monitors could be posted at the crossing, a measure that might assuage Israeli concerns about weapons smuggling.
A permanent opening of the Rafah crossing would mean an end to the crippling Israeli and Egyptian blockade imposed on Gaza after the Hamas takeover, which prevents free trade and bars the vast majority of Gaza's two million people from leaving the territory.
Only one of Gaza's four commercial crossings to Israel, Kerem Shalom, is currently operating, down from four before 2007.
A small number of people, mainly medical patients, business people and aid workers, use the Erez crossing to enter Israel, usually bound for the West Bank.
Hamas has indirectly run the Palestinian side of Kerem Shalom commercial crossing, collecting taxes and fees on imports.
At Erez, Hamas maintained security control from a checkpoint near the crossing, while the Palestinian Authority had a small office to coordinate with the Israeli side.
Key issues were not addressed in the Cairo talks.
A major sticking point has been the Hamas military wing and its arsenal, which Hamas has said is not up for discussion.
Hamas officials have assured the Fatah negotiators that the military wing would maintain a low profile as part of any deal.