Palestinian groups Hamas and Fatah have agreed to implement an Egypt-brokered unity deal to end a rift of more than five years, dpa quoted Egyptian television and a presidential official as saying Thursday. "Under Egyptian auspices, leaders of the two movements agreed Wednesday night in Cairo to start immediate measures to implement their reconciliation," said Yasser Ali, a spokesman for Egyptian President Mohammed Morsi. He said details of the agreement would be disclosed in a statement to be issued later by Morsi's office. Morsi Wednesday met with Palestinian President Mahmoud Abbas, who heads the secular Fatah party, which governs the Israeli-occupied West Bank. Later in the day, Morsi held talks with Khaled Meshaal, the leader of Hamas, which rules the Gaza Strip and is an offshoot of the Egyptian president's Muslim Brotherhood. Egypt brokered a unity deal between Fatah and Hamas in 2011 that was meant to pave the way for a joint interim government and elections in 2012, but negotiations faltered. The deal also aimed to end a bitter, and at times violent, feud between the two factions. Relations between the two parties soured after Hamas defeated Fatah in the 2006 parliamentary election and seized control of Gaza a year later after routing forces loyal to Abbas. Earlier this month, Hamas allowed Fatah to hold a mass rally in Gaza for the first time since 2007 and Hamas supporters held rallies in West Bank cities, signalling an improvement in ties.