Rival Palestinian factions Hamas and Fatah said they reached an agreement on Thursday for the return of their unity government in Gaza ahead of crucial negotiations with Israel next month.
The Palestinian rivals had set up a unity government of independents in June but it never took hold, with Palestinian president Mahmud Abbas accusing Hamas of running a "parallel" administration as de facto ruler in the Gaza Strip.
Hamas in turn accused Abbas's Palestinian Authority, headquartered in Ramallah, of not paying its 45,000 employees in Gaza.
"Fatah and Hamas have reached a comprehensive agreement for the unity government to return to the Gaza Strip," Jibril Rajoub of Fatah told AFP.
Senior Hamas official Mussa Abu Marzuk and Fatah's head of delegation, Azzam al-Ahmad, confirmed that an agreement had been reached after two days of talks in Cairo.
The talks were crucial for internal Palestinian divisions to be set aside and to agree on a unified strategy during talks with Israeli negotiators in October.
The October talks, under Egyptian mediation, are aimed at reaching a durable ceasefire after the 50-day offensive launched by Israel on Gaza.
The war killed more than 2,140 Palestinians, and 73 on the Israeli side.
It ended on August 26 when the two sides agreed in Cairo on a ceasefire and to hold future talks on Palestinian demands to end an eight-year blockade of Gaza and exchange prisoners in Israeli jails for the remains of Israeli soldiers killed in Gaza.
Hamas and Fatah talks were also crucial ahead of an international donor conference on October 12, to be hosted by Cairo, on the reconstruction of Gaza.
The July-August war caused a vast amount of destruction to homes and infrastructure in densely populated Gaza, leaving more than 100,000 Palestinians homeless, according to the United Nations.
"The unity government will supervise the crossings (into Gaza)... to facilitate the reconstruction of the Gaza Strip," Abu Marzuk said.
He said the two factions agreed to creating a mechanism for construction material to pass in to Gaza.
The two movements have also found a "solution .. to the problem of employees," Abu Marzuk said, referring to the Hamas accusations that the Palestinian Authority had not paid Gaza government employees.
"This meeting was essential because it tackled all the issues and hindrances that obstructed reaching an agreement," he said, referring to a reconciliation deal inked in April.
The April deal was inked to end years of bitter rivalry between the Fatah faction of Abbas, which dominates the West Bank-based Palestinian Authority, and the Islamist movement Hamas, which has ruled Gaza for the past seven years.
Following the deal, the rivals set up a government of independents, the first united administration in seven years, which took office in early June.
But sharp divisions quickly emerged over the control of Gaza, where the Hamas government formally stepped down on June 2 but remained the de facto power.
Abbas accused Hamas of operating a "shadow government" and threatened to end the unity deal unless the Islamists allowed the new government to function properly.