Leaked news this month that China and Iran had come to the verge of signing a 25-year trade and military partnership agreement struck like a geopolitical storm in Washington—a rising rival of America and a longtime foe joining forces to threaten the United States’s predominant position in the Middle East. The agreement ambitiously promises to bring a huge Chinese presence into Iran’s economic development, in exchange for a regular supply of heavily discounted Iranian oil.

Yet in Iran and China themselves, the reaction was hardly ebullient. Critics of Iran’s beleaguered president, Hassan Rouhani, called the deal a new Treaty of Turkmenchay, after the notorious 1828 accord under which a weakened Persia ceded much of the South Caucasus to the Russian Empire. In Beijing, a government spokesman who was asked about the deal dodged rather than criticize Washington, insisting blandly that Iran is merely one of many countries with which China is “developing normal friendly relations,” and claiming not to have further information about the reported deal.

Tehran’s and Beijing’s ambivalence hardly suggests a loving embrace between the two adversaries of America; rather, it reveals the conundrum each faces in pursuing closer ties with the other—conundrums that the United States can turn to our advantage. In recent years, as the United States has been bogged down in unrewarding conflicts in the Middle East, China has been quietly expanding its economic, diplomatic and even military activities in the region. Beijing’s motives are straightforward but varied: It seeks to advance its interests, such as a pressing need for energy imports and for destinations for surplus capital and labor. In practice, it tries to advance President Xi Jinping’s signature Belt and Road Initiative, which is aimed at reshaping regional economic topographies in China’s favor and counters what Beijing sees as an American effort to contain it. In short, China seeks to establish itself in the eyes of the world—and its own people—as a great power capable of contending with the United States.

Yet Chinese leaders are aware that few of the great powers have emerged unscathed from Middle East adventures and that they face a particularly formidable set of obstacles. The region’s deep political fissures make it difficult for outsiders to avoid taking sides in its many conflicts. This poses a risk for a China that aims to be a friend of everyone—Iran, Israel and Arab states alike—to maximize the benefits of its regional engagement while minimizing its commitments. Consistent with this balancing act, the leak of the China-Iran agreement roughly coincided with the biannual China-Arab States Cooperation Forum early this month, which prompted numerous proclamations of Chinese friendship with Iran’s Arab rivals.

Even more daunting is the outsize role played by the United States in the region, one that ironically benefits Beijing as it expands its economic ventures without being able to provide adequate security for its capital and citizens deployed to the region. For all its “wolf warrior” bluster, China continues to pick its battles with Washington. So far, it largely has chosen not to wage them in the Middle East—for example, doing little beyond diplomatic finger-wagging to shelter Iran from American secondary sanctions. So even as China seeks to make strategic gains in the Middle East, it does so sotto voce—bolstering its own role and challenging Washington’s without fanfare.

Iran, China’s foremost regional partner, faces a conundrum of its own. Squeezed by America’s “maximum pressure” campaign, Tehran needs whatever friends it can find. And China, which besides being rich and powerful shares Iran’s revisionist inclination to challenge the United States’s role in the international order, would seem to be a perfect match.

Yet Iran’s history has made it suspicious of external powers, and China’s “help” in recent years—buying Iranian oil in small quantities at a steep discount and crowding out Iranian domestic producers with low-cost imports—seems not to have engendered affection among the Iranian populace. What Iranians seem to desire is to be no one’s junior partner, but to be self-sufficient and stand among the likes of Russia and China as equals.

What amount to challenges for China and Iran in further developing their ties constitute opportunities for an America worried about the partnership between them. The United States should, at every step, aim to exacerbate the conundrums each faces. It should, for example, emphasize that Iranian dependence on China—besides being costly—is a policy choice and that the door remains open to the rest of the international community if Tehran is willing to compromise on its nuclear ambitions and regional policies. And Washington should enlist regional partners—who may otherwise prefer to enjoy the benefits of good relations with Beijing while leaving it up to the United States to confront China when it empowers Iran through arms sales or investment.

Make no mistake: The China-Iran relationship has long been important for both countries, contributing for example to Iran’s nuclear and missile advancements. And whether in the form of formal partnership agreements or simply ad hoc cooperation, those relations are very likely to grow closer yet in coming years, as China tries to project power westward and Iran seeks to insulate itself from the debilitating effects of American power and enhance its own regional influence. But while the deepening of the Iran-China relationship may be inevitable, the United States shouldn’t let it be easy for either Tehran or Beijing.

Comments