The fall of Aleppo to Iran-backed pro-government forces has brought a bubbling conflict between Iran and Hamas to the boil, with the former making thinly-veiled threats to cut off the Palestinian group.

The threats came from Heshmatollah Falahatpisheh, a member of the Iranian Foreign Affairs and National Security Committee, in the wake of increasing solidarity from Hamas to Aleppo.

In an interview last week with the reformist Qanun newspaper, Falahatpisheh made clear there would be material consequences if Hamas did not change its position on Iran’s role in the region, not least its intervention in Syria.

#عمانيون_ندين_اباده_حلب

إلى المتعاطفين مع النظام الغاشم هل تفضلون رجال العز والنخوه حماس ام تفضلون الطاغية بشار؟ pic.twitter.com/q7kBBhKv7t — سلطنة عمان العظمى (@AlGlnda) December 16, 2016

All pictures are taken from Hamas' 29th anniversary march. Hamas fighters hold sign saying "Aleppo is being annihilated #We_are_all_Aleppo"

If Hamas does not reconsider the “inconsistent positions by its leaders,” Tehran will be forced to turn to “the most detested of available options” – turning to other Palestinian factions such as the Palestinian Islamic Jihad, said Falahatpisheh on 21 December.

The tensions between Hamas, the most renowned anti-Israel movement in the region, and Iran are significant, as Tehran legitimises its foreign policy through its "Axis of Resistance" against Israel and the United States, which includes Hamas, Lebanon's Hezbollah and Syrian President Bashar al-Assad.

“Currently, the sphere of influence of the resistance extends from the Indian subcontinent to the borders of Israel,” Falahatpisheh said.

مقاتل من كتائب القسام يرتدي علم الثورة السورية خلال إحياء الذكرى الـ 29 لانطلاق حركة حماس وسط قطاع #غزة #غزة_مع_حلب#أزيحوا_السيسي_وبشار pic.twitter.com/Quw757AXyi — 🇪🇬 ثائرة ربعاوية 🇵🇸 (@th4ra) December 17, 2016

Hamas fighter wears a Syrian revolutionary flag

The harshness of the senior Iranian official's tone underlines the depth of the crisis in relations. Falahatpisheh accused Hamas of continuing to “support terrorist groups working under the umbrella of the Syrian opposition”.

He described Hamas’ current stance as “hostile,” and saw the group as moving out of Iran’s sphere of influence.

Falahatpisheh demanded Hamas not forget that Syria was, in his words, “a leader in the resistance, and much of its misfortunes are now due to this position”.

Left: Hamas fighters hold sign saying "#Aleppo is burning. God curse the tyrant of the Levant Assad and his thugs"

Hamas' support for Aleppo

“We are following with great pain what is happening in Aleppo and the horrific massacres, murders and genocide its people are going through, and condemn it entirely,” read a statement from Hamas at the height of the bombardment of Aleppo.

The movement asked those whom it described as “wise, free and responsible in the ummah (global Islamic community) to act promptly to protect civilians in Aleppo and save those who are still alive”.

It also called on international, human rights and humanitarian institutions around the world to intervene immediately to “stop these dreadful massacres, stand by the children, women and elderly of Aleppo and save them from death and destruction”.

A child wearing a Hamas bandana poses next to a fighter holding a sign saying "Aleppo is being annihilated #We_are_all_Aleppo"

Ahmed Youssef, a senior Hamas figure and former foreign relations head, told al-Khaleej Online that his group would not change course – not least after what happened in Aleppo.

Youssef said the group’s position reflected that of the Palestinian public, who themselves have suffered similar brutality during Israel’s repeated assaults on the Gaza Strip.

He was adamant that Hamas would continue to stand in solidarity with Syria and condemn the killing of civilians there.

Hamas fighter with a sign on his back saying "#Aleppo_is_being_annihilated"

During Hamas’ recent parade commemorating the movement’s 29th anniversary, civilian Gazans and Qassam Brigade soldiers alike were seen carrying banners in solidarity with the people of Aleppo.

The images went viral on social media, leading to praise from many Arab social media users but criticism from pro-Iran outlets.

Left: Hamas fighter with revolutionary Syrian flag. Right: A young Gazan woman holds a sign saying "Aleppo" with tears of blood on either side in the midst of Islamic flags.

Hamas-Iran tensions

On the issue of Iranian-Hamas relations, the Iranian outlet Qanun threw in its own two cents: “It seems that Hamas moved away from Iran a long time ago."

“This can be clearly seen from what is taking place in Syria. All of this is occurring at a time when leaders of the movement deny the existence of any differences of opinion between Tehran and the movement.

“In reality, however, their actions contradict their words.”

“Its financial relations with the Arabs are the reason behind the incoherent positions among the movement’s leaders,” Falahatpisheh said, going as far as to add that the “Israeli lobby” was influencing the group’s position.

A young Gazan woman holds a sign saying "Aleppo" with tears of blood on either side in the midst of Islamic flags.

He accused a “current” within Hamas of “seeking to save Daesh under the label of the Syrian opposition”.

There are also tensions within Hamas's leadership over Iran's influence on the group's direction, which were made public through information leaked to the London-based pan-Arab al-Sharq al-Awsat daily.

The leaks came from a meeting of senior Hamas leaders, where a leading commander of Hamas's military wing expressed his concern over growing Iranian influence due to its financial and military support for the group.

A young Gazan child with a tear in her eye wears a Hamas bandana, with the Syrian revolution's colours painted on her cheek, and "Aleppo is being annihilated" written on her forehead

Salah al-Arouri is a founding commander of Hamas’ military wing, the Izz ad-Din al-Qassam Brigades, and the movement’s preeminent figure in the West Bank.

According to the leaks, he accused Qassem Soleimani – leader of the Quds Force, the elite branch of Iran’s Islamic Revolutionary Guards Corps (IRGC) – of trying to weaken the Qassam Brigade’s allegiance to Hamas and attempting to absorb them into the Quds Force.

Arouri also protested in the meeting against the pressure Soleimani was putting on the group to pledge complete loyalty to Tehran in the same way Islamic Jihad had done when their general secretary, Ramadan Shalah, led a delegation to Tehran and pledged an oath of allegiance to the Iranian regime.

Armed Hamas fighters pose with a sign saying "Aleppo is being annihilated #We_are_all_Aleppo"

Relations between Hamas and Iran deteriorated sharply following the outbreak of the Syrian revolution in 2011. The following year, the group’s leadership left Damascus after being based there for more than a decade. Their funding was reduced drastically shortly thereafter.

“Our position on Syria affected relations with Iran. Its support for us never stopped, but the amounts [of money] were significantly reduced,” a senior Hamas official said in 2013.

In response to this turn of events, Iran ramped up funding for other Palestinian groups, most notably the Palestinian Islamic Jihad.

Islamic Jihad moves closer to Iran

Islamic Jihad has staged its own show of force in Gaza in recent months in a rally including its military wing – the al-Quds Brigades.

Shalah, quoted in the al-Sharq al-Awsat leaks as criticising Iranian influence, spoke via video link at the October rally, saying: "[Iran] is the only country which commits to the unending support of the Palestinian cause”.

Islamic Jihad has had their own tensions with Iran over Syria for the past two years, but have recently changed tune and become one of Iran’s most vociferous Palestinian proxies.

#صور: الحركة النسائية في حماس تنظم وقفة تضامنية مع أهالي حلب أمام مقر المندوب السامي بمدينة غزة صباح اليوم. pic.twitter.com/884iaOlpjD — #غزة 24 (@gaza24pal) December 15, 2016

Children with cheeks painted in the colours of the Syrian revolution hold pictures from Aleppo

Earlier this year, Shalah led a Palestinian Islamic Jihad delegation to Tehran and met with Soleimani.

“The defence of Palestine amounts to a defence of Islam,” Shalah said, adding: “The Arab states did not support the popular uprising in Palestine and will never support it since it contradicts their leaders’ agendas. Iran is the only state that supports the intifada and the martyrs’ families.”

Soleimani pledged to provide $70m in annual assistance to the Palestinian Islamic Jihad after the visit, which could explain their change in direction.

Gazans hold up the hashtag "#We_are_all_Aleppo"

JPost reported that the move could be seen as a snub to Hamas following the 2015 visit by the movement's political chief Khaled Meshaal to Iran’s arch-rival Saudi Arabia, which appeared to mark a significant warming of relations with the Gulf state.

At the end of his interview, Falahatpisheh said that Tehran “does not see Hamas as the whole of the resistance.

“If Hamas continues its current political direction in obstructing things, then Iran will develop new relations with other Palestinian groups without seriously harming the resistance.”