Palestinian factions have agreed to hold general elections by the end of 2018 after talks in Cairo spearheaded by rivals Hamas and Fatah, a joint statement by all the groups which took part said on Wednesday.

According to the statement, the factions deferred the choice of a final date for the elections to Palestinian President Mahmoud Abbas.

A senior Fatah official told Haaretz on the eve of the talks that despite Hamas' declarations regarding reconciliation talks, it remains in control of security in the Gaza Strip. In addition, Hamas appointed a number of its own officials to government positions since it considers itself in charge of Gaza.

At the same time, Hamas has accused the Palestinian Authority of avoiding its commitments to reconciliation. They claim PA representatives insist on discussing PA control of Gaza, but avoid discussing cooperation between the PA and Hamas, as Egypt intends. According to Hamas, cooperation is supposed to include Hamas' integration into all PLO institutions, the formation of a unity government and the lifting of sanctions imposed by the PA on the Gaza Strip.

Leaders of the Palestinian factions that met in Cairo in recent days announced that they had reached agreements on all the issues on the table, including allowing full government functioning in the Gaza Strip and holding both parliamentary and presidential elections by the end of 2018.

The statement was announced after 11 hours of consecutive talks held at Egyptian intelligence headquarters, which began on Tuesday. Egypt prevented any leaks about the talks' content, though the two factions did not originally express much optimism. But due to Egyptian pressure on both sides and fear of public reaction to their failure, the factions' representatives announced that they had reached agreements on all issues.

In previous agreements, such as the Cairo agreement of 2011, the Palestinian factions similarly came to an agreement on all the issues, though progress stalled when it came to implementing the agreement.

A senior Palestinian official who participated in the recent talks told Haaretz that there is consensus on all the issues but the real test will be in whether leaders respect the agreement and fully implement it.

The statement notably made no mention of whether Hamas will be allowed to continue to be armed; the issue was not placed on the negotiating table. In the text, representatives emphasized the importance of implementing the understandings, but did not give any details of such processes to come.

A different Palestinian official who participated in the talks told Haaretz that the real test of the moment will be the extent of the government's full functioning in Gaza and overcoming the ongoing security dispute. "The next few days will tell whether this is really being carried out in a well-ordered manner."