Recent gains by Islamic State in Iraq have raised questions about the viability of the Obama administration’s strategy to degrade and ultimately defeat it. Thus far, President Barack Obama has ruled out the use of U.S. ground forces and opted for a mix of air strikes and arming elements in Iraq that have a vested interest in fighting Islamic State. The results of this approach have been mixed. What has become clear, though, is that to defeat Islamic State, the Obama administration must engage with elements of Iran’s Revolutionary Guard Corps, who are increasingly on the front lines battling Islamic State alongside motivated Iraqi forces.

Facts on the ground in Iraq necessitate such a dialogue. Talking to each other through the Kurds and the central government in Baghdad, as is happening now, has been ineffective. Intelligence sharing, coordination of forward operations and air strikes among commanders on both sides could start to turn the tide against Islamic State.

There would be considerable trepidation in Congress and among U.S. allies in the region over such an approach. Limiting the conversation to pushing Islamic State out of Iraq can alleviate those fears — for now. The United States could also use its platform with the guard to take up sectarian issues that will plague Iraq after Islamic State’s defeat and to make sure that Iran uses its influence over various Shi’ite political parties to not settle old scores but rather address Sunni grievances.

The Iranian power structure is complicated. The elected government of Hassan Rouhani is the face of a layered leviathan where clerics, merchants and security services all jockey for power. The ultimate arbiter of Iran’s foreign policy is the supreme leader – and he is heavily influenced by the Revolutionary Guard.

The Revolutionary Guard operates outside the confines of the traditional armed forces. It acts as the tip of the proverbial spear, responsible for Iran’s foreign policy in hotly contested areas, such as Iraq, Syria and Lebanon. The guard answers only to Ayatollah Ali Khamenei and has sizeable influence over Iran’s economy. Many of the Islamic Republic’s current and former politicians have served in the Revolutionary Guard. One has to look no further than its seizure of a cargo ship in the Strait of Hormuz last month — something that is hard to imagine being authorized by Rouhani’s cabinet — and how effective it has been in mobilizing Shi’ite militia to try to retake Ramadi after its fall to Islamic State to know where the locus of hard power rests in Iran.

The United States has designated elements of the Revolutionary Guard, such as the Quds Force, as terrorist organizations, and many in Congress and the military hold the groups responsible for the deaths of U.S. service men and women in Iraq and Afghanistan. Revolutionary Guard leaders, such as Qasem Soleimani, have been subject to an international travel ban put in place by the United Nations since 2007. Yet it was he who came to the aide of the central government in Baghdad, and to the Kurds in Arbil, when Islamic State was on the offensive last year.

The U.S. military, because of legal and political prohibitions, can’t talk to Soleimani directly, even though it is clear that he is responsible for not only Iran’s interests in Iraq but also for mobilizing resistance to Islamic State among Iraq’s Shi’ites. But those prohibitions should not be allowed to block all cooperation with the guard.

Limited collaboration with the Revolutionary Guard is not without precedent. After the Sept. 11 attacks, the United States and Iran coordinated their efforts to overthrow the Taliban in Afghanistan. Then, talks started at the political level but eventually included U.S. and Iranian military commanders. Discussions about Islamic State could follow the same blueprint. They don’t have to be publicized and should include other groups in Iraq, such as the Kurds, that have good working relationships with both Washington and Tehran.

The tectonic plates are shifting in the Middle East. The United States must do what it can to assure longstanding regional allies that it will abide by security commitments, but it must not box itself into outdated thinking. Iranian and American national-security interests converge in defeating Islamic State. Many other differences will remain.

Only a dispassionate approach to talking to our adversaries could help induce similar cooperation from Iran in Iraq. Such an effort would be in line with the best traditions of an American foreign policy that produced rapprochement with China and detente with the Soviet Union. Talking to Rouhani has us on the precipice of a nuclear accord. Talking to the Revolutionary Guard could help reverse the tide against Islamic State.