Editor’s Note: This article is included in our ‘Conflict Hotspots 2014’ dossier which can be accessed here .

Born of a common struggle against Israel and nourished by common benefactors in Syria and Iran, Sunni Hamas and Shiite Hezbollah have long been natural allies despite their sectarian differences. Ever since the early 1990s, when Israel exiled Hamas’ leadership to Lebanon, the two groups have cultivated an alliance that has shaped the Middle East’s balance of power for decades.

But the crisis in Syria has ruptured the old “axis of resistance,” with regional forces giving the two organizations opposing stakes in the conflict and bringing unprecedented tension to their relationship. While Hezbollah fighters have fought and died for Bashar al-Assad in some of the civil war’s fiercest battles, Hamas has thrown in its lot with the rebels and retreated deeper into the embrace of Sunni Islamist powers in the region.

For a time, it appeared that the partnership might be over, with Hamas calling on Hezbollah to extricate itself from Syria and Hezbollah accusing Hamas of funneling weapons and technology to Sunni jihadists. Yet the two groups appear to have looked beyond Syria’s civil war and calculated that more is to be lost than gained from a total divorce. Despite outbursts of inflammatory rhetoric, Hamas and Hezbollah have apparently agreed to disagree on Syria while maintaining a strategic partnership against Israel.

Feet in the Fire

Wary of alienating either their patrons or the Arab street, Hamas and Hezbollah cautiously avoided taking any strong position during the Syrian conflict’s earliest stages in 2011. But even then there were hints that their studied neutrality could not last. For example, like Hamas, Hezbollah urged the Damascus regime to enter a dialogue with the opposition. But unlike Hamas, Hezbollah soon rescinded this suggestion, most likely under pressure from Tehran.

As international powers became increasingly involved, Hamas and Hezbollah were also pressured to take a stance that would define their attitudes towards the conflict.

In December 2011, Hamas made a bold move to transfer its political bureau from Syria—where it had been based since 1999—to Qatar, a main sponsor of the Syrian rebels and post-Mubarak Egypt. “We supported the Syrian regime as long as it was fighting the Israeli enemy,” said Hamas deputy foreign minister Ghazi Hamad, “but when it oppressed its people we decided to part ways with it, despite the fact that this is considered a big loss for Hamas.” Although the group tried to project a veneer of neutrality after leaving Damascus, high-ranking leaders appeared to tip their hands. In February 2012, Hamas Prime Minister Ismail Haniyeh delivered an emotional speech at al-Azhar mosque in Cairo, where he lauded “the heroic people of Syria who are striving for freedom, democracy, and reform” as worshipers chanted, “No Hezbollah and no Iran.”

Hezbollah, seeking to avoid a public rupture with Hamas, refused to condemn the group’s decision to leave Syria and issued an internal order preventing Hezbollah spokesmen from criticizing their Palestinian counterparts. But Hezbollah increasingly characterized the Syrian uprising as a foreign-orchestrated plot to weaken resistance to Israel.

Hezbollah Secretary-General Hassan Nasrallah was quick to remind Palestinians that during the Israel-Hezbollah War of 2006 and Operation Cast Lead in Gaza (2008-2009), Syria had provided both organizations with arms like no other Arab state. He went on to mock the Gulf Cooperation Council (GCC) states by requesting that they send arms into Gaza. Nasrallah’s ultimate aim was to highlight the Gulf monarchies’ de facto neutrality in the Arab-Israeli conflict while challenging Doha and Riyadh’s pan-Arab credentials.

Despite these pleas for solidarity, Hamas and Hezbollah’s tension over Syria worsened throughout 2012 and 2013. In the spring of 2013, Hezbollah sent its own fighters into Syria to dislodge the rebels from Qusayr, a strategically vital town along the Syrian-Lebanese border that had been under rebel control since July 2012. Following seventeen days of fierce fighting, the rebels were finally expelled from the city, a victory largely attributed to Hezbollah’s direct intervention. In response, an Egypt-based Hamas leader publicly urged Hezbollah “to take its forces out of Syria and to keep their weapons directed against the Zionist enemy.”

In turn, Hezbollah sources claimed that Hamas operatives had assisted Sunni jihadists in Qusayr after discovering tunnels dug with Iranian devices that Hezbollah had transferred to Hamas for use in Gaza. This was a particularly grim accusation, since Hezbollah reported losing many soldiers to booby-trapped tunnels during the siege. Hamas authorities have continuously denied these claims, but other rumors have persisted, including that Hamas members fought against the Syrian regime at the Yarmouk Palestinian refugee camp in Damascus.

Rapprochement?

With tensions coming to a head, Hamas and Hezbollah officials met in Beirut last summer in an attempt to restore the relationship. Since then, spokesmen for each group have taken pains to insist on their agreement to disagree on Syria and to continue their cooperation on other fronts.

From Beirut, some representatives of Hamas reportedly continued on to Iran, which is said to have cut its support for Hamas in the wake of the group’s flight from Syria. This development particularly alarmed members of Hamas’ military wing, which is heavily dependent on the arms it receives from Tehran. Reflecting divisions within Hamas about how to approach the Syrian conflict, Hamas military commander Marwan Issa reportedly urged political leader Khaled Mashal to keep a line open to Iran, a call that was supported by Hamas co-founder Mahmoud al-Zahar.

While negotiators worked to rebuild ties, regional events recast the field. As the war in Syria dragged on and rival rebel factions began to turn on each other, a military coup rocked Egypt, expelling the elected Muslim Brotherhood government, restoring the secular military to power, and resealingthe border between Gaza and Egypt. Gone was Hamas’ dream of a new regional balance of power with Muslim Brotherhood franchises holding power in Egypt, Gaza, and Syria. Meanwhile, Qatar continued to offer Hamas a political home in Doha and generously supported development projects in Gaza, but the small Gulf state proved unwilling to provide the military assistance that Hamas had relied on from Iran.

These developments paved the way for Hamas’ rapprochement with Iran after two years of deteriorated ties, which in turn eased the way for the normalization of its ties with Hezbollah. In September 2013, following several weeks of meetings, Hamas and Hezbollah announced that they had formed a stronger pact with Iran to fortify the tottering “axis of resistance.”

Remembering the Stakes

Even as Hamas gradually restores its relationship with Iran and Hezbollah, some of its officials still wave the Free Syrian Army (FSA) flag. “Hamas does not flirt nor does it plead with anyone,” said Haniyeh in a defiant speech last October. “It does not regret nor does it apologize for honorable positions, just to placate others. It does not feel that it is in the type of trouble necessitating that others be paid to save it from.” But in light of Assad’s strengthened hand in Syria, a proliferation of hostile al-Qaeda-linked forces in the Syrian opposition, and a narrowing regional pool of useful allies, realism may compel Hamas to agree to disagree with its allies in Lebanon and Iran.

Hezbollah is unlikely to abandon Assad anytime soon. Its concerns about anti-Shiite jihadists, or Takfiris, gaining influence in Lebanon, Iraq, and Syria naturally pit the Party of God against the Sunni-dominated Syrian rebellion—a dynamic that may be encouraged by an ongoing spate of car bombs and other jihadist attacks on Hezbollah strongholds in Lebanon. Even if Hezbollah quietly begins to reconsider its role in Syria, its patrons in Iran—with whom Hezbollah is much more intricately tied than Hamas—will lean hard on the Lebanese force to hold the line.

In this context, tension between the Palestinian and Lebanese groups will probably continue as long as the Syrian stalemate does. But by the same token, in the absence of an Israeli-Palestinian peace treaty and an end to tensions along the Israeli-Lebanese border, Hamas and Hezbollah will continue to view their respective struggles against Israel as a common denominator that justifies a strong alliance despite their opposing stakes in Syria.

This article was originally published by Atlantic Council on 30 January 2014.

Giorgio Cafiero is a Washington, DC-based foreign affairs analyst. On Twitter: @GiorgioCafiero.

Peter Certo is the editor of Foreign Policy In Focus, a progressive foreign policy journal published by the Institute for Policy Studies.

For additional reading on this topic please see:

Hezbollah’s New and Old Wars

How Powerful is Hezbollah? Local, Regional and Global Implications

The End of the Muqawama? Should Hamas and Hizbollah Face Reform or Collapse

For more information on issues and events that shape our world please visit the ISN’s Weekly Dossiers and Security Watch.