A senior Hamas delegation traveled to Tehran last week to attend celebrations marking the 1979 Islamic Revolution. The meeting comes at a tense time in the Hamas-Iran relationship. The group has historically enjoyed Tehran’s generous financial, material and political support, but relations soured in 2012 when the Hamas leadership – then based in Damascus – publicly sided with the largely Sunni rebels against the Iranian-backed Syrian regime. The latest visit to Tehran indicates that Hamas’ political leadership is working hard to get itself back in the Islamic Republic’s good graces.The delegation included head of Hamas’ international relations, Osama Hamdan, politburo member Mohammad Nasr and Hamas’ ambassador to Iran Khalid al-Qaddoumi.They met with Ali Shamkhani, secretary of the Supreme National Security Council – Iran’s highest national security body, led by Supreme Leader Ali Khamenei himself. According to Qaddoumi, the Iranians pledged their continued steadfast support for the Palestinians, in line with Iran’s unwavering post-revolutionary policy of opposing Israel and supporting Palestinian extremist groups.Hamdan told Iranian media that the visit’s main objective was reaching an understanding on the Syrian conflict, and that Hamas now supports a political resolution in the country. It’s a dramatic about-face from the group’s previous anti-regime rhetoric – itself a sharp reversal from over a decade of unflinching support for the Syrian regime. Hamas’ political leadership first set up a base in Damascus after it was expelled from Jordan in 1999 over accusations of illegal activity. Syria was one of the few countries to offer it a base, and while there the regime and its Iranian backer provided the group with weapons and money.When the Syrian conflict erupted in 2011, however, Hamas found itself in a bind: continuing to side with its Shi’ite patrons could cost it support across the Sunni Arab world.Hamas finally declared its support for the opposition in early 2012, when Ismail Haniyeh, at the time Hamas’ prime minister in Gaza, told crowds at Al-Azhar University in Cairo that his organization “salutes the heroic people of Syria who are striving for freedom, democracy and reform.”But the break with Syria and Iran was not unanimously endorsed within the group. Indeed, several members affiliated with the military wing continued to court Iranian support and technology just as before. In March 2014, Israel intercepted a cargo ship bearing Iranian arms headed for Gaza. In August of that year, Iran’s Islamic Revolutionary Guard Corps claimed that it had provided the Hamas military wing with the most advanced rockets it used in its 50-day summer war with Israel. The military wing’s preference for the Iranian axis – even while the political wing flirts with Tehran’s regional rival Saudi Arabia – has since become a major fissure point in relations between Hamas’ two camps.Last week’s visit suggests Hamas seeks to again present a unified front – one aligned with Iran while paying lip service to diplomacy in Syria to satisfy Sunni opposition to the regime there.Calling the meetings “excellent,” Hamdan said Iranian officials were in full support of what Hamas calls the “Jerusalem Intifada.” A Hamas website also reported that Iran was ready to begin funding the reconstruction of houses in the West Bank and Jerusalem that Israel demolished after its occupants committed acts of violence.This is not Iran’s first attempt at fomenting unrest in the West Bank – since 2014 senior Iranian officials have called for encouraging an uprising in the territory. Several of Iran’s proxies, including Hezbollah and the Gazabased al-Sabirin, have recently formed cells in the West Bank as well. Tehran appears committed to opening a new front against Israel, thereby posing direct threats from its proxies in Lebanon, Gaza and West Bank.The summit in Tehran comes at a crucial time in Iran-Hamas relations.Hamas is a fractured group, with its political wing feuding with its military counterpart, and the Gaza-based leadership at odds with the external upper echelon based in Qatar. Hamas’ political leaders have openly complained about their frustration with Iran, and have received various forms of backing from Riyadh to Doha to Ankara.Still, this week’s summit shows the organization knows it will find no more committed or generous patron than the Islamic Republic of Iran.Grant Rumley is a research fellow at Foundation for Defense of Democracies, where Amir Toumaj is a research analyst. Follow them on Twitter @GrantRumley and @AmirToumaj.