Here is a look back at the history of the dispute:
• In 2006, the leaders of Hamas take part in elections to the Palestinian Parliament for the first time, sweeping to a landslide victory over Fatah, which had dominated it since it was established.
A unity government is installed with Hamas taking key posts but it is dogged by International demands, rejected by the hard-liners, that they renounce violence and recognize Israel and past peace deals.
• In early 2007, simmering tensions between the rival factions erupt into bloody clashes in Gaza.
After a week of violence in June, Abbas dismisses the unity government and declares a state of emergency in the territory.
But Hamas fighters rout pro-Abbas forces and take control, a move the president calls a coup.
• In April 2011, Fatah and Hamas say they have reached an understanding to create an interim government to prepare for elections, but implementation is repeatedly delayed.
In January 2012, the rivals strike a prisoner exchange agreement. The following month, they agree that Abbas should lead an interim government, but the deal is disputed within Hamas and never implemented.
• In April 2014, the Abbas-led Palestine Liberation Organization and Hamas finally agree on a unity government.
It is sworn in on June 2 but fails to exercise authority over Gaza where Abbas accuses Hamas of setting up a parallel administration.
In July-August 2014, the factions put up a united front after Israel launches a 50-day blitz against Gaza in response to rocket fire, but the unity government falls apart months later.
• In May 2017, Hamas makes a major revision to its founding charter, easing its stance on Israel after having long called for its destruction.
The group says its struggle is not against Jews but against Israel as an occupier, and accepts the idea of a Palestinian state in territories occupied by Israel in the Six-Day War of 1967.
The group — which remains blacklisted as a terrorist organization by the US and the EU as well as Israel — is seen as seeking to ease its isolation without marginalizing hard-liners in its ranks.
• Tensions persist over the formation by Hamas of an “administrative committee” in Gaza which is seen as a rival Palestinian government.
Abbas puts the squeeze on Hamas including by cutting payments for electricity supplies to the territory.
An Egyptian-led reconciliation push receives a major boost when Hamas agrees on Sept. 17 to dissolve the committee and cede civil power, saying it is ready for talks on a new unity government and elections.
• In early October, Palestinian Authority Prime Minister Rami Hamdallah visits Gaza for the first time since 2015.
His ministers take formal control of government departments in the territory.
• On Oct. 10, the two factions open detailed reconciliation talks mediated by Egypt in Cairo.
On Oct. 12, the two sides announce they have reached a deal.
• Fatah says Abbas will visit Gaza within a month and sanctions he had imposed on the territory will soon be lifted.
Some 3,000 Palestinian Authority police officers are to redeploy to Gaza, a member of the negotiating team says.
But the two sides remain sharply at odds over the future of Hamas’s 25,000-strong armed wing, which the Gaza leaders say is non-negotiable.