Hamas is so desperate following the ouster of Egyptian President Mohamed Morsi that it is now seeking to mend fences with Iran.
The honeymoon between Hamas and Iran is about to resume -- bad news for both the peace process and stability in the region.
Relations between Hamas and Iran became strained after the Palestinian Islamist movement decided to support the rebels fighting against Syrian President Bashar Assad's regime.
Both Syria and Iran have since been boycotting Hamas, which until recently enjoyed political, financial and military aid from the two countries.
For some time, Hamas did not appear to be very worried about the loss of its allies in Tehran and Damascus.
Hamas leaders believed that the support of Qatar and Egypt's ruling Muslim Brotherhood was enough to keep it in power in the Gaza Strip.
But now that Hamas has lost the backing of the largest Arab country, Egypt, its leaders realize that they can not depend only on Qatar's support.
Hamas leaders see the decision to charge Morsi with "collaboration" with their movement as a "declaration of war" against their regime in the Gaza Strip.
Hamas leader Ahmed Bahr scoffed at the charges against Morsi, dubbing them "ridiculous." He also warned the Egypt's new rulers of tightening the blockade on the Gaza Strip by turning Hamas into a "hostile" entity.
Beleaguered Hamas officials revealed this week that they have contacted the Iranians with the hope of patching up differences between the two sides.
Ahmed Yusef, a senior Hamas official, was quoted as saying that his movement recently held two meetings with Iranian government officials in an attempt to achieve reconciliation between the two parties.
"Iran and Hamas have a common interest and we are keen on not losing anyone," Yusef said in an interview with Asia News. "The case of Palestine is the case of the entire Islamic nation and we want everyone to meet around this case."
Hamas's apparent rapprochement with Iran is paving the way for Iran to play a major role in the Palestinian arena.
This does not bode well for the Palestinian Authority and its president, Mahmoud Abbas, especially on the eve of the resumption of the peace talks with Israel.
It is one thing when Qatar and Egypt's Muslim Brotherhood support Hamas. After all, the Qataris and Morsi could never be as bad as Iran.
But Iran's support for Hamas means that the Islamist movement means renewed financial and military support. It also means that Iranian military experts could soon arrive in the Gaza Strip to train members of Hamas and other radical groups.
With the support of Iran, Hamas will step up its efforts to foil any attempt by the Palestinian Authority to regain control over the Gaza Strip. And with Iran's backing, Hamas and other Palestinian groups will do their utmost to foil any attempt to achieve peace between the Palestinians and Israel.
Some Palestinian Authority officials expressed fear that Hamas, on instructions from Tehran, would try to initiate a confrontation with Israel in an attempt to embarrass Abbas and thwart US Secretary of State John Kerry's effort to resume the peace negotiations.
Without dealing with the new Iranian threat, it is hard to see how the Palestinian Authority would be able to move forward with any peace process with Israel. The presence of the Iranians in the Gaza Strip will scare Abbas and his aides and make them think twice before reaching any deal with Israel.