Palestinian fighters of the Izz ad-Din al-Qassam Brigades, the military wing of the Palestinian Hamas organization, taking part in a parade in Al Meena square in the west of Gaza City in August. (Mohammed Saber/European Pressphoto Agency)

— In the congressional battle being waged over the Iran nuclear deal, critics point to a likely windfall of cash and weapons that could flow from Tehran to terrorist groups, including the Islamist militant movement Hamas, which has fought three wars with Israel.

Yet assertions that Hamas will benefit from the Iran deal are far from certain. Hamas is officially on the outs with Iran — and has been for several years.

Whether a newly ascendant Iran, flush with petrodollars and free from economic sanctions, would bring Hamas back into its orbit as a client sub-state is one of the great unanswered questions bedeviling military analysts and intelligence agencies in the Middle East.

In the past three years, there is ample evidence that relations between Hamas and Iran have suffered badly — to the point that Hamas is now seeking support from Iran’s biggest adversary in the region, Saudi Arabia.

Hamas Deputy Foreign Minister Ghazi Hamad called bilateral relations with Iran “no good at all.” “Our problems with Iran are well known,” he said in an interview with The Washington Post last week.

Although Iran is Shiite and Persian, and Hamas — formally known as the Islamic Resistance Movement — is Sunni and Arab, Tehran lavished support on Hamas as an armed movement against their shared enemy Israel.

But Iran and Hamas fell out when Hamas in 2012 sided with the rebels and Islamist militants fighting civil war against Syrian President Bashar al-Assad.

The diplomat said Iranian support for Hamas in arms, training and cash was “tremendous” back in 2007, the year Hamas took control of Gaza. One Gazan academic estimated that Iran was providing Hamas with $250 million a year, though no verifiable figures exist.

“We did not want to lose them,” Hamad said.

Now? “Assistance was halted and remains suspended,” Mousa Abu Marzouk, the deputy head of the Hamas political bureau, recently told Al Jazeera news.

Critics of the Iran deal in Congress and Israel often point to Iranian support for Hamas as one reason to oppose the pact, which would lift sanctions in exchange for a rollback of Iran’s nuclear ambitions.

In a House Foreign Affairs Committee hearing before the summer recess, Rep. Edward R. Royce (R-Calif.), the committee’s chairman, said the nuclear accord would award Iran with a “cash bonanza,” some $100 billion in frozen Iranian oil revenue held in restricted overseas bank accounts. Even if most of that money goes to pay debts to the Chinese and rebuild the Iranian economy, that could still leave a couple billion on the table.

A fellow committee member, Rep. Brad Sherman (D-Calif.), said Iran would use the money to fund terrorist groups.

They support Hamas, Hezbollah and Houthi, and those are just the organizations that begin with the letter ‘H,’ ” said Sherman, who opposes the Iran deal.

Iran supports Houthi rebels in Yemen in a proxy war with Saudi Arabia. Relations are closer than ever between Iran and the Lebanese-based Shiite movement Hezbollah, which serves as an Iranian ally to prop up Assad in Syria. Hezbollah and Israel fought their last war in 2006.

Yet for the past year, Israeli military officials have said that the military wing of Hamas is starved for cash and no longer imports substantial weaponry from Iran, but instead builds homemade rockets to attack Israel in munitions workshops in Gaza.

“It’s the worst relations in years,” said Alex Vatanka, senior fellow at the Middle East Institute in Washington.

Adnan Abu Amer, a political scientist and commentator in Gaza who has good connections with Hamas, said Hamas is running on financial fumes. “They are in a terrible spot,” he said.

“Iran was the main source of support that kept Hamas alive between 2007 and 2012,” Abu Amer said. “There is no denying this. You could see the money on the ground. Iran wanted Hamas to be a Hezbollah in Gaza. It didn’t work out that way.”

The question now is who will support Hamas — and how.

There is evidence that Hamas militias continue to get support from Iran — but at a far diminished level. A freighter carrying 40 medium-range rockets was intercepted by Israeli commandos last year in the Red Sea, a shipment they say was destined for Gaza.

Israel’s domestic security agency, Shin Bet, this month revealed it had captured a 21-year-old Hamas operative who claimed that Iran was funding tunnel-digging and smuggling in advanced weaponry, including frequency-jamming electronics that could down Israeli unmanned aerial vehicles.

That report has been treated with skepticism by some Hamas watchers in Gaza and Israel, who cite the timing of the Shin Bet announcement, during the heat of the congressional debate over the Iran deal, as well as the age and position of the alleged informant, who dug tunnels for a living.

Regardless, Hamas is clearly looking for some new friends.

The military-backed regime in Egypt is openly hostile, seeing Hamas as a Palestinian extension of its arch enemy, the Muslim Brotherhood, declared illegal in Egypt.

Egypt has accused Hamas militants of aiding and abetting anti-government radical Islamist groups in the Sinai. Egyptian President Abdel Fatah al-Sissi has shut down almost all of the smuggling tunnels between Egypt and Gaza that supplied Gaza with cheap imports and provided a boon in customs duties for Hamas.

Seeking support elsewhere, Hamas leader Khaled Meshal and a Palestinian delegation made a pilgrimage to Mecca and met with Saudi Arabia’s new monarch in July. Saudi Arabia has traditionally kept Hamas at arm’s length.

Saudi Arabia’s King Salman, a close U.S. ally in the oil-rich Persian Gulf, could provide Hamas with funds, but not training or arms, because most of the weapons in the Saudi arsenal come from the United States.

Hamas officials described the meeting in Mecca as a new beginning between old antagonists. But Saudi Foreign Minister Adel al-Jubeir said the Palestinians had come to Mecca to pray, not parlay, and stressed that Saudi relations with Hamas had not changed for the better.

In its attempt to improve relations with Iran, Hamas may also find itself blocked by its domestic rivals from the Palestinian leadership in the West Bank. Hamas and the Palestinian government in Ramallah are openly antagonistic.

Earlier this month, Ahmed Majdalani, a top official from the Palestine Liberation Organization, visited Tehran and met with Iranian Foreign Minister Mohammad Javad Zarif.

The PLO leader said Palestinian Authority President Mahmoud Abbas would visit Tehran in October or November, the first high-level talks in years. Iran and the PLO fell out decades ago over Palestinian support for Iraq in the 1980s Iran-Iraq war.

Meir Litvak, a Hamas expert at Tel Aviv University, said it is possible that within Hamas there is also a struggle.

“You can’t call it a split exactly,” he said. “But there are disagreements, tensions, both within the political wing of Hamas — some who want to reach out to Saudi Arabia, others not — and the military wing, who want the weapons that Iran can bring.”

Read more:

Full text: Obama’s news conference on the Iran nuclear deal

The military operation in Gaza that still haunts Israel one year later

Today’s coverage from Post correspondents around the world