Palestinian President Mahmoud Abbas has decided he has a better chance of making peace with the militant Islamist group Hamas than he does of signing a treaty with Israeli Prime Minister Benjamin Netanyahu.
In the short term at least, that might serve the interests of both Abbas and Netanyahu. It could equally open the door to Hamas dominance over Palestinian politics, as fellow Islamists rise to power elsewhere in elections following the Arab Spring.
Abbas and Hamas leader Khaled Meshaal signed a deal in Qatar on Monday to form a unity government tasked with preparing long-overdue elections later this year. Although such accords have proved worthless in the past, things might be different now.
Teaming up with Hamas, shunned by Israel and the West for its violence, would stop the Middle East peace process in its tracks. But Abbas, 76, believes it is not going anywhere in any case, so reuniting the deeply split Palestinian national movement may seem his best bet for an honourable legacy.
The Palestinians have not spoken with one voice for five years, since Abbas' secular Fatah movement was kicked out of the Gaza Strip by Hamas gunmen in 2007.
He hopes that by healing the rift he could improve prospects for his bid to win recognition of a Palestinian state by as many countries as possible, regardless of a lack of peace with Israel.
But there are major obstacles to overcome, chiefly that Hamas is still formally pledged to the destruction of Israel whereas the Palestine Liberation Organisation, Fatah and the Palestinian Authority - all headed by Abbas - recognise the Jewish state and have interim roadmap accords with it.
Any Palestinian government must unambiguously and explicitly commit to nonviolence, U.S. State Department spokeswoman Victoria Nuland said on Monday.
It must recognize the State of Israel. And it must accept the previous agreements and obligations between the parties, including the roadmap ... our red lines remain the same.
That would require a revolutionary U-turn by Hamas, which does not appear to be on the cards. But the Islamist movement has previously offered long-term ceasefires in return for a state with similar borders to those sought by Abbas.
And it is evolving to adapt to the new political line-up in the Middle East created by the Arab Spring. Meshaal has been making more concessions to Abbas than hardliners want to see.
To their surprise and dismay, the unity agreement made Abbas the new prime minister, at the head of an interim cabinet of technocrats that will not include Hamas figures.
Analysts detect a split in Hamas between those who have controlled the Israeli-blockaded Gaza Strip for the past five years and Meshaal, leader-in-exile of the movement's political bureau, based until recently in Syria but now seeking a new home to escape the crisis enveloping their hosts in Damascus.
I believe this reconciliation agreement will tear Hamas apart, said Samir Awad, political science professor at Birzeit University in the West Bank.
This agreement will not succeed, because Khaled Meshaal and Hamas' political office abroad want to pay a certain price for unity with Fatah and the PLO. But this price is unacceptable for Gaza.
Analysts believe Meshaal, a native of the West Bank, is gambling on persuading a majority of Hamas leaders to back him in an internal vote due in March.
Abbas is also gambling with his reputation as a peacemaker by cosying up to the Islamist movement.
He can't have it both ways, Netanyahu said on Monday.
The Israeli leader has urged Abbas to continue talks aimed at reviving peace negotiations suspended 15 months ago, but Abbas says Netanyahu is not genuinely prepared to grant the Palestinians a sovereign, viable state of their own.
Professor Shmuel Sandler of the Begin Sadat Centre for Strategic studies at Israel's Bar-Ilan University says Abbas, like Meshaal, was also having to fall in line with the growing Islamist trend in the Arab world.
The two movements will eventually clash because they each control a separate territory and they are not helped by the fact that Israel lies between those tracts of land, he said of the difficulties of Palestinians in running Gaza and the West Bank.
As far as Netanyahu was concerned, it eases pressure on him in the short term at home and abroad, allowing him to pin any blame on the Palestinians for the moribund peace process.
In any case, at the moment he is far more preoccupied with the Iranian issue, Sandler said, referring to Israeli efforts to disrupt Tehran's nuclear development programme.
Abbas was lampooned by a Palestinian youth movement on Tuesday in a cartoon circulating on Facebook that showed him in a Superman costume next to a list of his six-in-one titles, including the newly-acquired prime minister in place of Western-backed Salam Fayyad, who was vetoed by Hamas.
But West Bank economic analyst Nasir Abdel-Karim said the agreement to put Abbas at the head of the proposed unity government was a canny move to assure foreign powers who provide the aid essential to the Palestinian Authority's survival.
It means the general policy of the government would be in agreement with the policy of President Abbas and the PLO, which signed the Oslo accords and which is negotiating with Israel, he said. It's a message of political and security assurances that Abbas is on top of the government.
What is important, but not announced, is that it appears that Qatar has decided in cooperation with Gulf countries to foster the agreement economy-wise, and maybe it also pledged to sell the agreement in the international community.
A diplomat in the region, speaking on condition of anonymity, said Meshaal's unilateral decisions were risky for him, but could yield substantial benefits if he came out on top in an internal struggle within Hamas:
A sharp debate began inside Hamas even before Meshaal and Abbas signed what they signed, the diplomat said.
It began when the announcement was made that the two were meeting in Doha in what was a complete absence of coordination with Gaza leaders. If Meshaal gets away with it, he may become the unquestioned leader of Hamas.
Meshaal at 55 has time on his side. Abbas at nearly 77 has no obvious successor. Israeli Hamas-watcher Matti Steinberg of Haifa University believes Meshaal's objective is to become the Palestinian leader.
He is accommodating himself with the Muslim Brotherhood in Egypt, said Steinberg, referring to the rise to power in the Cairo parliament of Hamas's spiritual and political mentors, who were unlikely to endorse a renewal of violence to the north.
They don't want any trouble with Israel from Gaza.
(Reporting by Ali Sawafta and Jihan Abdalla in Ramallah, Nidal al-Mughrabi in Gaza and Ori Lewis in Jerusalem; Editing by Alastair Macdonald)