Fears over the rise of the Islamic State group in Afghanistan are spawning some unlikely alliances in the region. According to a report by the Wall Street Journal, which cited Afghan and U.S. officials, Iran -- a Shiite powerhouse currently engaged in proxy and direct wars with several Sunni states and groups -- is now providing weapons, ammunition and funds to the Taliban.

“Iran supplies us with whatever we need,” a Taliban commander named Abdullah told the Journal, claiming that he was approached by an Iranian intelligence official during his detention in the country. “He asked me how much money I made, and that he would double my salary if I went to work for them [Iranians] in Afghanistan.”

Abdullah claimed that the Taliban were receiving weapons such as 82mm mortars, light machine guns, AK-47 rifles, rocket-propelled grenades and materials for making roadside bombs from Iran. These weapons are allegedly shipped into Afghanistan through the common border between Iran, Afghanistan and Pakistan, the Journal reported. Toward this end, the drawdown of U.S. troops from Afghanistan has also helped smugglers, who can now cross the porous border undetected.

Shia-majority Iran and the Sunni militant group Taliban have long been foes and almost came to a full-blown war in 1998 when Iran deployed more than 70,000 troops along the Afghan border in response to the killing of its diplomats. The Iranian officials were allegedly killed by the Taliban, which was then in complete control of the Afghan government. A full-scale conflict in the region was prevented only after the United Nations intervened.

However, recent reports have hinted at the formation of an alliance between the two ideological foes, spurred by the rise of a common enemy in eastern Afghanistan.

“Iran seeks to counter Daesh [ISIS] with the Taliban,” an unnamed Afghan security official told the Journal. ISIS, which currently controls regions in Syria and Iraq, has the potential to unite splintered militant groups in Afghanistan under a common banner, Nicholas Haysom, the U.N. envoy to Afghanistan, warned in March. Earlier in January, local militants in Afghanistan and Pakistan had released a video, claiming that several groups from the two countries had pledged their allegiance to Abu Bakr al-Baghdadi, the self-proclaimed caliph of ISIS.

“Iran is betting on the re-emergence of the Taliban,” a Western diplomat, whose name was not revealed, told the Journal. “They are uncertain about where Afghanistan is heading right now, so they are hedging their bets.”

However, while Iran, which is already battling ISIS in Iraq and Syria, might have justifications in building closer ties with the Taliban, the move pits it directly against the United States. Iran and the U.S. are currently attempting to negotiate a nuclear deal, which, if successful, would bring billions of dollars in sanctions relief.

“Across the region, Iran is stepping up its support for militants and rebel groups,” Ed Royce (R., Calif.), chairman of the House Foreign Affairs Committee, told the Journal. “With billions in sanctions relief coming, that support goes into overdrive.”