CAIRO (Reuters) - Rival Palestinian groups agreed on Sunday to hold presidential and legislative elections by January 2010 but remained deadlocked over the key issue of forming a unity government that would prepare for the polls.

Diplomats and analysts see the success of the Egyptian-sponsored talks as key to reuniting Palestinians after 21 months of schism between Hamas-ruled Gaza and the West Bank, where the Fatah group of President Mahmoud Abbas holds sway.

Fatah and Hamas, the largest two Palestinian groups, differ fundamentally on how to deal with Israel. Hamas believes in armed struggle, though it is willing to consider a truce, while Abbas backs negotiations with the Jewish state.

The groups agreed on holding presidential and legislative elections by January 25, 2010, Wasil Abou Youssef, secretary-general of the Palestine Liberation Front, told Egypt’s state-run Middle East News Agency.

But participants said differences remained between Fatah and Hamas on whether the unity cabinet that would emerge from the talks be composed of political groups or non-partisan technocrats, as demanded by Western powers and Egypt.

“It is a standstill on the issue of the government,” said Walid al-Awad of the communist People’s Party.

The groups agreed on February 26 to form five committees to also tackle issues such as the composition of security agencies in the Gaza Strip and the West Bank.

The groups have yet to agree on an electoral law and whether it would be based on proportional representation or constituencies, Awad and Abou Youssef told Reuters.

Awad said two committees discussing national reconciliation and the reform of the Palestine Liberation Organization (PLO) concluded their work on Saturday.

The PLO, dominated by Abbas and the groups loyal to him, have represented the Palestinians since 1964 but the more recently created Islamist movements, such as Hamas and Islamic Jihad, have never been part of it despite a 2005 agreement to bring them under its umbrella.

In Gaza, Hamas official Taher al-Nono told Reuters: “There was progress in some issues last night. There is an optimism, a cautious optimism.”

The West had shunned a previous unity government headed by Hamas after it won parliamentary elections in 2006.

Palestinian Prime Minister Salam Fayyad said this month he intended to resign by the end of March to pave the way for the formation of a unity cabinet. Abbas, who appointed Fayyad after Hamas routed Fatah in Gaza in June 2007, asked him to remain in office until results emerged from the talks in Cairo.

The new government is also expected to lead efforts to reconstruct the Gaza Strip after Israel’s three-week military offensive, which ended in January.

Awad said his party has put forward a suggestion that the prime minister and six cabinet posts -- foreign affairs, interior, reconstruction, education, information and finance -- be held by independent ministers. The remaining seats would be decided on political basis, he added.