President Obama’s response to the jihadi deluge in Iraq is perfectly Obamaesque. Sensibly, he foreswears big military reimmersion. This will displease only hawks who pray for large-scale U.S. air attacks plus lots of U.S. aid and ground-level advice. Such hawkish ideas cannot plausibly cure the profoundly political and religious underpinnings of what’s happening in Iraq.

Yet, Obama might take some of these military actions anyway just to deflect political pressures at home. Meantime, he’ll dispatch 350 troops to target jihadis and train Iraqis. Say what? Didn’t we already have tens of thousands of U.S. trainers training almost 1 million Iraqi forces for nearly 10 years only to have them abandon their U.S. arms and uniforms at the sounds of distant gunfire? And wouldn’t U.S. drones certainly acquire better targets far more readily? Give me a break! Also, behind the scenes, Obama is trying to get rid of Iraqi Prime Minister al-Maliki, the bad guy in the story. If Obama manages to install his guys in Baghdad, these “successors” will have large claims on the White House. In sum, the Obama plan avoids the worst, the costly futility of military overreach, but offers no strategy to stem and turn the perilous jihadi tide.

There’s only one strategy with a decent chance of winning: forge a military and political coalition with the power to stifle the jihadis in both Iraq and Syria. This means partnering with Iran, Russia, and President Assad of Syria. This would be a very tricky arrangement among unfriendly and non-trusting partners, but the overriding point is that they all have common interests. All regard the jihadis as the overwhelming threat, and all would be willing to take tough joint action. And with this fighting arrangement in place, the “partners” could start seriously fixing the underlying political snake pits in Damascus and Baghdad.

Now, don’t start firing rockets at me just yet. Hear me out. First, every state, even the United States, works with bad guys, adversaries and enemies whenever the need is great, whenever it suits reality. Don’t forget, Iran helped us protect the western border of Afghanistan for almost the first two years of America’s war effort there. Tehran didn’t like the Taliban and neither did we. The cooperation stopped when President George W. Bush threatened to overthrow the Ayatollah’s regime with his “axis of evil” speech.

Consider as well that Russia and states over which it has great influence remain to this day a main waystation for moving U.S. troops and supplies in and out of Afghanistan. To some degree, Washington colludes with China to tamp down the nuclear threat from North Korea. Moscow has been helpful in dealing with Iranian nuclear problems. Moscow and Washington continue to share intelligence to fight terrorists worldwide, despite the Ukraine crisis. And stare at this one: Vietnam—the country we fought in one way and another for 20 years—cooperates with us against China on South China Sea conflicts. Finally, always hold in mind that America’s toughest tough guys—Richard Nixon, Henry Kissinger, Ronald Reagan, James Baker, et al.—not only contained Russia and China, but negotiated major treaties and agreements with them. All this is common sense realism opposed only by political hacks and ideological quacks.

I’m certainly not saying that Assad is a good guy and that we should abandon pursuing his eventual departure, or that we can now trust Russia and Iran. Washington has and will have serious problems with all these countries. And most certainly, the U.S. will have to stay on its guard. But the fact is that there is common ground with Moscow and Tehran to combat the biggest threat to all of us at this moment. Russia frets all the time about the jihadis in the Mideast making joint cause with Muslim extremists in Russia; it’s Moscow’s No. 1 security issue. Iran worries greatly about the Sunni jihadis torturing and killing Shiites in Syria and Iraq. There’s nothing more frightening in the world today than these religious fanatics.

President Putin will not stop giving us a pain in Ukraine and asserting what he sees as his rights and interests on his borders. But he doesn’t want to burn bridges entirely with the U.S. because he doesn’t want to suffer the full economic consequences of all-out confrontation with the West. So Putin would have an incentive to work seriously with Washington against the common opponent in Syria, i.e., to show that Russia can still be of value to American diplomacy. There’s also good reason to believe that Iran would be helpful in both Syria and Iraq as a path to relieving its internal economic hell. To me, this is Tehran’s central strategic motivation behind the nuclear talks with the West. Above all, it wants relief from the international economic sanctions. And to reinforce this, President Obama should tell President Rouhani of Iran that genuine cooperation on Syria and Iraq would help increase political receptivity in Washington toward reducing those sanctions. (This is not to say the U.S. should make concessions in the nuclear talks to gain Iran’s help in the Mideast. It shouldn’t.)

Iran is already said to have dispatched small military units to Baghdad. These need to be increased significantly to levels agreed upon between Tehran and Baghdad, with the U.S. being part of that conversation. Iranian troops should not go into territories predominantly inhabited by Sunnis, but the Iraqis need strong and immediate help and better it comes from Iran than from the United States. And to be blunt, the Iraqis can’t put much together quickly on the battlefield, and the Iranians can. American hawks and neocons have never been able to understand that Middle Easterners always rely too much on the Americans who come to help them and end up deeply resenting that help. Trying to deal with this massive Iraqi-Syrian upheaval with U.S. fighters and drones would be laughable if it were not so potentially costly to both Americans and Middle Eastern friends. Nothing works there or in any other part of the world unless our friends and allies stand up for themselves and fight for themselves. America’s hawks will never learn this lesson.

In sum, President Obama must start addressing the jihadi threat not just in Iraq, but in Iraq and Syria. Second, he has to fashion strategic alliances with Iran, Russia and Assad to deal with the threat effectively and immediately. Third, that doesn’t mean no military role for the U.S.; it means U.S. military aid in various forms in the context of that broader alliance. Fourth, with all this moving into place, Washington can then focus on the necessary political changes first in Baghdad and ultimately in Damascus. For the time being, Assad is needed to fight the bad guys. Over time he can be eased out—as long as his Alawite people are protected in some kind of federal Syria. Hopefully, Iraqis will maneuver Maliki out of power much more quickly and try to restore political support and some degree of unity under a federal banner as well.

A federal or decentralized power system is the only means to get the non-jihadi warring parties to live in peace with one another. In a federal system, the minority Syrian Alawites (who belong to a branch of Shiism) can protect themselves against the majority of Syrian Sunnis; and in Iraq, the minority Sunnis can have a wall against the majority Shiites. This approach was universally rejected when I first proposed it 10 years ago in a New York Times op-ed piece, and then subsequently with then-Senator Joe Biden. Now, it’s pretty clear that if anything could avoid partition in both countries and thus perpetual warfare, it would be a federal division of power.

Above all, this is not the time to blunder into horrendous religious and civil wars with direct and extensive U.S. military force. Our only chance to stop the jihadis in their tracks and push them back is to band with mutually wary allies who can and will fight now to check the common and dangerous foe.