About 500 Shiite volunteers from Tal Afar attend a combat training session at a military camp in the Shiite shrine city of Karbala in central Iraq on September 25, 2014 to join the fight against jihadists of the Islamic State (IS). (Mohammed Sawaf/AFP/Getty Images)

If President Obama truly wants to degrade and destroy the Islamic State, he must find a way to collaborate with Iran — the one great power in the Middle East with which the United States is still at odds. Engagement with Iran — while hard and complicated — would be a strategic game-changer, with benefits spreading from Iraq to Syria to Afghanistan.

We are now in the air-power phase of the campaign against the Islamic State. This part usually goes well — think of the air wars against Afghanistan, Iraq and Libya. The United States has the world’s most advanced planes, rockets and drones, and an extraordinarily capable military. But what follows is usually messy — think of Afghanistan, Iraq and Libya. Ground forces have to fight locals and guerrillas in irregular combat. The most important questions turn out to be political. Are the local groups, tribes and sects fighting with the Americans or against them? What kind of power-sharing deals need to be in place to get them to support American efforts?

In Iraq, the central problem remains that the Sunnis do not feel represented in the Baghdad government. Obama keeps saying that there is a new government in Iraq, but the implication that it is inclusive is false. Sunnis continue to have ceremonial posts with little power. The army continues to be dominated by Shiites at the upper echelons. The result is visible on the ground. A recent article in the New York Times pointed out that “after six weeks of American airstrikes, the Iraqi government’s forces have scarcely budged the Sunni extremists of the Islamic State from their hold on more than a quarter of the country, in part because many critical Sunni tribes remain on the sidelines.”

The United States has some influence with the Iraqi government, but Iran has far more. The Shiite religious parties that today run the country have been funded by Iran for decades. Their leaders lived in Tehran and Damascus during their long exiles from Saddam Hussein’s regime. When Washington sought to remove the previous prime minister, Nouri al-Maliki, Iran provided the push that made it happen. If the goal is to get the Iraqi government to share more power with the Sunnis, Iran’s help would be invaluable, perhaps vital.

In Syria, Washington’s strategy is incoherent. It seeks to destroy the Islamic State there and attack Jabhat al-Nusra and the Khorasan group but somehow not strengthen these groups’ principal rival, the Bashar al-Assad regime. This is impossible. As these terrorist groups lose ground, the army that will most easily take advantage will be that of the Syrian regime, not the disorganized and weak Free Syrian Army. If there is some way to make this strategy less contradictory, it would be to work toward some power-sharing deal in Syria that includes elements of the Assad government — such as generals and intelligence heads. But Washington has no contact or credibility with anyone in the Assad regime. The government that does is in Tehran.

In Afghanistan, Washington’s and Tehran’s interests have always coincided. Iran opposed the Taliban, helped oust it and cooperated with the United States at the Bonn Conference, held after the fall of the Taliban, to install the new Afghan government of Hamid Karzai. As Afghanistan faces an uncertain future with a shaky power-sharing deal, Iran’s assistance would be a major stabilizing force.

Engagement with Iran would have to be carefully coordinated with Saudi Arabia and other Arab states. But now those nations also share a common enemy with Iran in the Islamic State and groups like it. And engagement will not be a rapprochement; Iran and the United States have too many issues that divide them, unless things really change in Tehran.

Iranian President Hassan Rouhani told me this week that, in their phone conversation last year, he and Obama had agreed “that there were many areas where Iran and the United States could cooperate” but that “first we must get past the nuclear issue.” I asked him to describe the contours of such cooperation — assuming that the nuclear deal happened — and he quoted an Iranian proverb that says roughly, “First take care of the child you have before you start thinking about the next one.”

When Richard Nixon and Henry Kissinger decided in the 1970s that Iran would be one of their “regional policemen,” they did so out of recognition of Iran’s geostrategic importance, not simply because they supported the shah. Vali Nasr, a leading scholar of Iran, told me that if the United States “wants to limit its micromanagement of the Middle East, it will have to find countries that are stable, influential and effective with which it can work. And potentially, Iran is one of those countries.” But, as Rouhani made clear, all of this waits on the nuclear deal.

Read more from Fareed Zakaria’s archive, follow him on Twitter or subscribe to his updates on Facebook.