Despite its slowdown in growth, the Indo-Pacific region remains the heartland of the world economy, home to the most important sea lines of communication and many economic powerhouses, some of which (like Japan and South Korea) are treaty allies of the United States, and others of which (like Vietnam and Malaysia) are consequential de facto allies. Since Obama’s first term, his administration has rightly been determined to focus more on Asia, in order to both defend U.S. allies against Chinese naval expansion and protect global trade. Of course, turmoil in the Middle East has interfered. But the increasingly tense military standoff in maritime Asia demands that the United States find a way, at least over time, to reduce its granular involvement in the conflicts of the Middle East.

There is no more efficient way to do this than to enter into a strategic understanding with Iran. Like the understanding that the United States forged with China in 1972, this would be less a matter of treaty language than of mutual respect and of expectations quietly agreed to by leaders on both sides.

The United States needs Shia Iran to fight the extremist Sunnis of the Islamic State, and at the same time to pressure the Shia government in Baghdad to moderate its posture toward the Sunnis, in the name of internal stability in Iraq. Should the unhelpful Islamic government in Turkey grow more intractable, Iran could also prove helpful in balancing against it. (After all, Iran and Turkey have uneasily coexisted and offset each other since the Safavid-Ottoman War of the early 17th century.) In addition, Iran and the United States could potentially work in tandem in Syria to preserve the political power of the country’s ruling Alawites—the Alawite sect being an offshoot of Shia Islam—even as they work together to remove President Bashar al-Assad from power. Furthermore, Iran could help steady neighboring Afghanistan in the wake of an American troop withdrawal, by serving as a buffer against pro-Taliban Pakistani and Saudi elements. The American military has already quietly encouraged Iranian involvement there.

All of this would be in Iran’s interests, and in America’s too. And while Iran might do some of these things on its own, doing them in coordination with America would measurably help stabilize the greater Middle East.

The practical approach to Islamist terrorism is not always to fight terrorists everywhere, but to play Shiites against Sunnis and vice versa, depending upon the circumstances. By warming up to Iran, we would not be siding with the Shiites against the Sunnis per se, but rather manipulating both sides more effectively than we have in the past. Nor should ending our belligerence toward Shia Iran mean deserting our Sunni allies in Saudi Arabia, Egypt, the Persian Gulf, and elsewhere. We must go to great lengths to reassure them, in fact. I am not endorsing a flip-flop—an exchange of one alliance for another. Handled properly, a détente with Iran need not jeopardize our relationships with Sunni nations. It could, however, motivate them to be more honest allies than before. For decades, the Sunni dictatorships in Egypt and Saudi Arabia took their military alliances with the United States for granted, even as they fostered the hateful climate that produced the 9/11 terrorists. As for the Sunni jihadists themselves, they are already our committed enemies. We must continue to deal with them through a combination of military strikes, support for Sunni moderates (where they can be found), and creative diplomacy (of the sort that might be exemplified by a rapprochement with Iran).