Following a split with Tehran due to differences over the Syrian civil war, Hamas recently decided to patch up its relationship with Iran, and Iranian cash is once again pouring into the Gaza Strip.
Hamas's new relations with Iran are flourishing just as the Assad regime, a close Iranian ally that has received massive Iranian battlefield and material assistance, commits another chemical atrocity.
"Hamas finds itself at a crossroads in regards to its relationship with Iran, and the puppet organization of the Iranian sphere in the region, Hizballah," Boaz Ganor, Executive Director of the International Institute for Counter-Terrorism, in Herzliya, Israel, told the Investigative Project on Terrorism.
"Traditionally, Hamas's relations with Iran have been complex, since Hamas has been a branch of the Sunni Muslim Brotherhood in the Palestinian arena, which receives patronage from a Shi'ite entity. Therefore, unlike Palestinian Islamic Jihad, Hamas hesitated about being affiliated with Iran and the Shi'ites."
At the same time, Ganor said, "Hamas in recent years has found itself in a deep tear with the pragmatic Sunni regimes like Egypt, Saudi Arabia, and the Gulf states. This has found expression, among others, through the cessation of aid money, and restrictions placed on the heads of [the Hamas] movement in various [Sunni] states. As a result, the need for relations with Iran, Turkey, Syria, and Hizballah is only getting stronger."
According to a January assessment delivered by Israel Defense Forces (IDF) Chief of Staff Lt.-Gen. Gadi Eisenkot, Iran's investment in Gaza's two largest terrorist factions, the ruling Hamas, and Palestinian Islamic Jihad (PIJ), has grown to $100 million per year, representing a substantial increase in funding and in Iranian influence.
A lot of that money goes to Hamas's armed wing, the Izz ad-Din Al-Qassam Brigades, which uses it to manufacture medium-range rockets that can strike cities in central Israel, and newer, short-range rockets with massive warheads that threaten Israeli communities near Gaza.
Hamas's military wing continues digging a complex network of combat tunnels under Gaza City, and is saturating the whole of Gaza with weapons, including RPG launchers, anti-tank missiles, and mortar shells, arming its battalions for war with Israel.
While the PIJ organization has always been a direct proxy of Iran, Hamas only recently took the decision to return to Tehran's orbit, in line with a directive by Hamas's new chief, Yihye Sinwar, who views Iran as a useful source of assistance – in terms of funding, training, combat doctrines, and weapons manufacturing know-how, in the long-term war against Israel.
Hamas's decision to return to Iran's embrace is a victory for the organization's military wing, which continues to view Iran as a principal patron, and a defeat for the political wing, which wanted to improve Hamas's relations with the Sunni powers, led by Saudi Arabia.
Sinwar, together with Hamas "chief of staff" Muhammad Deif and senior influential leader Marwan Issa, have worked to ensure that it is Hamas's military wing that calls the shots on foreign relations.
But the reestablished friendship with Iran could end up harming Hamas significantly. In Syria, Iran's Islamic Republican Guards Corps (IRGC) has been leading the ground war on behalf of the murderous Assad regime. An assortment of Iranian-led forces have taken part in large-scale assaults on Sunni regions of Syria.
The Iranian-led axis, which includes the Assad regime, has conducted major massacres of Syria's Sunni population in the process.
The Assad regime, itself made up of Syria's Alawite minority sect – an offshoot of Shi'ite Islam – has in recent days conducted yet another crime against humanity, deploying chemical warfare indiscriminately against a Sunni region east of Damascus.
All of these developments could prove to be hugely embarrassing to Sunni Hamas, which is already being ostracized by Sunni Arab countries.
Dancing at two weddings
Ultimately, Hamas is trying to dance at two weddings, Ganor said. It is "trying to preserve reasonable relations with the Sunni world, and benefit from Iranian support."
This double game is earning Hamas growing criticism, even from those sympathetic to Islamists.
As a recent example, a Palestinian-Jordanian journalist, who is reportedly close to the Muslim Brotherhood, blasted praise Hamas's Sinwar showered on Qassem Souleimani, the Iranian commander of the Quds Force. Souleimani plays a key role in operations in Syria.
"Al-Sinwar's praise for Souleimani has angered most of the ummah [community]," Yasser Al-Za'atreh, wrote in a tweet flagged by the Middle East Media Research Institute (MEMRI). "[Souleimani] is a criminal, and [even] if he liberates Jerusalem it will not suffice to cleanse his hands that are stained with the blood of the Syrians. This is in addition to his crimes in Iraq and Yemen, and to his well-known sectarian [Shi'ite] fantasies. Thus, this miserable [praise for Souleimani] must stop, in order [for Al-Sinwar] to preserve credibility."
Meanwhile, the pragmatic Sunni Arab governments remain locked in a struggle against Hamas. Some have already branded Hamas a terrorist organization. These states are "closely watching the warming of relations between Hamas and the radical Shi'ite axis," Ganor said.
"From this perspective, one can expect every tightening of relations with Iran and Hizballah to be met with growing sanctions [against Hamas] from the Sunni states," he added.
All of these events might only further contribute to Hamas's isolation. This isolation, together with Gaza's growing economic distress, is one of the factors that drove Hamas to escalate the situation on the Gaza-Israel border, by orchestrating 'popular' marches, and using them as cover to initiate attacks on the security border fence.
Despite the consequences, there is no indication that the blossoming relations between Gaza and Tehran will sour any time soon.
Yaakov Lappin is a military and strategic affairs correspondent. He also conducts research and analysis for defense think tanks, and is the Israel correspondent for IHS Jane's Defense Weekly. His book, The Virtual Caliphate, explores the online jihadist presence.