Gaza rulers Hamas and their rivals in the occupied West Bank, Fatah, have agreed to hold the first Palestinian elections in nearly 15 years, officials from both sides told AFP on Thursday.

Polls will be scheduled within six months under a deal reached between Fatah leader Mahmud Abbas and Hamas political chief Ismail Haniyeh.

"We have agreed to first hold legislative elections, then presidential elections of the Palestinian Authority, and finally the central council of the Palestine Liberation Organization," said Jibril Rajub, a senior Fatah official.

The last Palestinian parliamentary elections were held in 2006 when Hamas won an unexpected landslide.

Saleh al-Arouri, a top Hamas official, said the deal was reached during meetings held in Turkey.

"This time we reached a real consensus," he said, speaking to AFP by phone from Istanbul.

The last time Palestinians went to the polls in a nationwide election was in 2006 when Islamist group Hamas won a landslide majority in parliament
The last time Palestinians went to the polls in a nationwide election was in 2006 when Islamist group Hamas won a landslide majority in parliament AFP / PATRICK BAZ

"Divisions have damaged our national cause and we are working to end that," Arouri added.

The two sides formed a unity government following the 2006 polls, but it soon collapsed and bloody clashes erupted in the Gaza Strip between the two sides the following year.

Hamas has since ruled Gaza, while Fatah has run the Palestinian Authority based in the West Bank city of Ramallah.

Numerous attempts at reconciliation have failed to close the rift, including a prisoner exchange agreement in 2012 and a short-lived unity government two years later.

The recent talks have been fuelled by two Arab states -- the United Arab Emirates and Bahrain -- normalising their relations with Israel.

The accords break with decades of Arab consensus that ties with the Jewish state should not be normalised until it has signed a comprehensive peace deal with the Palestinians.