A new deal was signed in Cairo on Wednesday between the two rival groups of Palestine -- Fatah and Hamas -- ending four years of enmity.

The two groups which have been at logger heads since 2006, agreed to form an adhoc government with elections slated early next year. Their relations strained since Fatah's exclusion from Gaza in 2007.

Egypt, which was instrumental in getting the foes together, urged both the parties to form the new government keeping in mind the interests of Palestinians in the long run. Fatah, headed by Palestinian President Mahmoud Abbas, is dominant in the West Bank, and the Hamas under Khaled Meshaal control the Gaza Strip.

Welcoming the pact, U.N. spokesman Martin Nesirky said, “reconciliation will now take place in a manner that promotes the cause of peace, security and non-violence.”

“Palestinians have paid a heavy price for their infighting,” said Azzam al- Ahmad, head of Fatah's team at the Cairo conference. “We are proud that we now possess the national will to end our divisions so we can end the occupation of Palestine ... the last occupation in history.”

Israel, however, condemned the agreement, which was brokered secretly by Egypt, as it will not secure peace in the Middle East and urged Abbas to ignore the Islamist movement of Hamas.

Israel said Fatah could not be a peace partner and maintain ties with Hamas, whose main aim is the destruction of the Jewish state.