Hamas appears to be drifting away from its longtime patron Iran _ part of a shift that began with last year's Arab Spring and accelerated over Tehran's backing of the pariah regime in Syria.
The movement's top leader in exile, Khaled Mashaal, wants Hamas to be part of the broader Islamist political rise triggered by the popular uprisings sweeping across the Arab world. For this, Hamas needs new friends like the wealthy Gulf states that are at odds with Iran.
For now, Hamas won't cut ties with Iran or close its headquarters-in-exile in the Syrian capital of Damascus, officials in the movement said.
However, relations have become increasingly strained.
Hamas has reduced its presence in Iran-allied Damascus in response to Syrian President Bashar Assad's brutal crackdown on a popular uprising against him. Hamas also rejected Iran's demand that the group publicly side with Assad, standing firm even when Tehran delayed the monthly support payments Hamas needs to govern the Gaza Strip, according to a senior Hamas official who insisted on anonymity because he was not authorized to discuss internal deliberations.
At the same time, Hamas is increasingly relying on political and financial support from the Gulf, particularly tiny Qatar, which also has close ties to the West.
This week, Qatar brokered a breakthrough unity deal between Mashaal and his longtime rival, internationally backed Palestinian President Mahmoud Abbas. After five years of separate Palestinian governments in the West Bank and Gaza, Abbas is now to head an interim unity government and lead the Palestinians to elections.
Qatar promised to help in case the international community will withdraw support for a transition government that _ though headed by Abbas _ would also be supported from the outside by Hamas.
The movement is still widely shunned in the West and is considered a terrorist group by the United States and Europe _ a legacy of the years in which it regularly claimed suicide bombings and other attacks on civilians in Israel.
"Of course, the safety net is there," Ahmed Yousef, a Gaza-based Hamas intellectual and Mashaal confidant, said of Qatar's pledges of support. "The financial support will be there. ... They will be generous to help the Palestinians, to rebuild Gaza and cover the shortage. If there is a financial problem, they will help."
Even as Qatar was mediating the unity deal, the Hamas prime minister of Gaza, Ismail Haniyeh, was leading his own tour through wealthy Gulf states Qatar, Bahrain and Kuwait. His tone was far more CEO than anti-Israel firebrand as he met Gulf rulers and investment groups about pumping money into struggling Gaza.
Palestinian officials who have been briefed on the Doha unity talks said Qatar asked Haniyeh to skip the next stop on his journey, a visit to Tehran. Gulf countries have moved aggressively to undercut Iranian influence as the region is reshaped by the Arab uprisings.
However, Haniyeh will likely be in Tehran on Friday, Hamas officials said.
It was not immediately clear whether his decision to go ahead was shaped by a desire not to snub the Iranians so brazenly or is part of a brewing internal conflict within Hamas. Some of the Hamas leaders in Gaza, who stand to lose influence in a power-sharing arrangement, have criticized the Doha deal.
Still, Haniyeh's meetings with Iran's leaders _ Assad's most enthusiastic supporters _ can prove politically embarrassing to Hamas. Readers commenting on a Hamas website this week overwhelmingly urged Haniyeh not to visit Iran because of Tehran's backing for Assad.
Before the Arab Spring, Hamas had few friends in the Arab world and relied on Iranian largesse and Syrian hospitality. According to some estimates, Iran paid several hundred million dollars a year to Hamas, crucial for keeping blockaded Gaza afloat. Damascus hosted Mashaal and his decision-making political bureau which was unwanted elsewhere.
But Hamas' parent movement, the pan-Arab Muslim Brotherhood, scored election victories after uprisings in Egypt and Tunisia last year, and is becoming influential elsewhere in the region.
"The Arab Spring awakenings had a pivotal effect on Hamas' world view," said Fawaz Gerges, director of the Middle East Center at the London School of Economics. "The rise of the Islamists to power has really given Hamas a strategic depth."
However, the widened support comes with demands that the Islamists moderate and not embarrass Brotherhood branches abroad as they seek to reach out to the broadest possible audience and gain political legitimacy through elections.
Gulf countries have moved aggressively to gain new leverage and to try to undercut Iranian influence.
"Hamas is moving into the Arab orbit," said Salman Shaikh, director of The Brookings Doha Center in Qatar. "This is one of the significant achievements of the Arab Spring and a reflection of how Gulf power has grown."
It seems unlikely Hamas will meet international demands to forswear violence _ but an alliance with Gulf states could nudge the group in that direction.
The Gulf leaders intensified pressure this week on Iran-ally Assad, by pulling their ambassadors and ordering out Syrian envoys from Kuwait to Oman. Last month, Qatar urged for an Arab military force to intervene to halt 11 months of bloodshed in Syria.
Yousef, the Mashaal confidant, said in an interview on Thursday that Hamas wants to be on good terms with everyone, including Iran and Syria, but his comments suggested a new confidence vis-a-vis the old patrons.
"We are not going to support anybody (just) because he is giving us shelter or safe haven," Yousef said, when asked about Iranian pressure on Hamas to publicly back the Assad regime. "If he is not happy with us, we can leave. We can find another save haven."
He also suggested the Iranians need Hamas more than the other way around. "They (the Iranians) are capitalizing on this image that they are helping the Palestinians," he said. "This is giving the Iranians some credibility in the way they think about their leadership in the region."
He did not say how Hamas would act if forced to choose between Iran and the Gulf. However, the Arab Spring-inspired paradigm shift he described _ Hamas seeking to share power with former political rivals and embracing pluralism _ would make Iran an unattractive choice in the long run.
Khaled Hroub, a Hamas expert at Cambridge University, said he believes Hamas won't leave the Iranian-Syrian orbit for good unless other Gulf countries, particularly regional powerhouse Saudi Arabia, pledge their support.
"They want to go beyond Qatar .. and hear from the Saudis, even if indirectly," Hroub said of Hamas. "This is a golden opportunity (for the Saudis). Syria is going down, you can break the whole Syrian-Iranian axis, maybe forever, and the Iranian influence on the (Levant), yet the Saudis are turning their backs," Hroub said.
Murphy reported from Dubai, United Arab Emirates. Associated Press writer Mohammed Daraghmeh in Ramallah, West Bank, contributed reporting.