The recent nuclear agreement between Iran and the P5+1 countries (China, France, Germany, Russia, the United Kingdom, and the United States) will have major implications for security in the Middle East. But the impact of the deal will be much wider.

Just how wide was demonstrated by Russian Foreign Minister Sergei Lavrov, who, even before the official press conference announcing that the agreement had been concluded, declared that the deal obviated any need for NATO missile defenses in Europe, which have long been a point of contention between the United States and Russia. The deal will also likely lead to billions of dollars of investment by India in Iran’s southern port of Chabahar, long-awaited progress on a gas pipeline from Iran to Pakistan, and perhaps even the provision of Iranian gas to a Europe eager to reduce its energy dependence on Russia.

Iran's President Hassan Rouhani shakes hands with his Chinese counterpart Xi Jinping before the opening ceremony of the fourth Conference on Interaction and Confidence Building Measures in Asia (CICA) summit in Shanghai, May 21, 2014. Mark Ralston / Reuters The biggest impact of all, however, may be on China. Iran and China have long-standing ties that are free of the historical baggage that complicates Tehran’s relations with Russia, the United Kingdom, and the United States. Modern Sino-Iranian relations predate U.S. President Richard Nixon’s opening to China, and China has been an indispensable security partner to Iran, including by supplying it with arms and, as Orde Kittrie noted in another article for Foreign Affairs, by providing it with key nuclear components.

Thanks to the two countries’ historically close relations and their mutual suspicion of the United States, many well-regarded China scholars expected China to play a spoiler role in the talks. But by all accounts, Chinese involvement was constructive. Beijing’s approach may have been motivated by a desire to shape a diplomatic outcome to head off either of two undesirable outcomes: a U.S.-Iranian war that could endanger China’s oil imports from the Persian Gulf or a U.S.-Iranian rapprochement that could leave that waterway ringed by American partners. Like Iran, China also likely sought the reversal of American sanctions, which in recent years threatened not only Chinese nuclear and arms exporters but more strategically important institutions such as Chinese banks and oil giants.

Throughout the nuclear negotiations, China was careful to maintain close ties with Iran from within the P5+1, shielding the country from the effects of sanctions resolutions even as it voted in favor of them at the United Nations. Chinese-Iranian trade increased from about $3 billion in 2001 to over $50 billion in 2014 (the precise number is difficult to determine), and Chinese oil imports from Iran rose in 2014 and 2015 to their highest levels ever, after temporarily declining in 2012–13.

For Chinese President Xi Jinping, the Iran deal could not have come at a better time.

Sino-Iranian security ties also continued to expand during the period of negotiations, and they went well beyond nuclear and arms exports. Chinese fighter jets reportedly refueled in Iran in 2010, and Chinese warships paid a visit to the Iranian port of Bandar Abbas in 2014—both firsts. Additionally, China at least indirectly supported Iran’s regional agenda by vetoing multiple UN Security Council resolutions on Syria.

The recently concluded nuclear deal will allow the already strong Chinese-Iranian relationship to expand unfettered. U.S., European, and UN sanctions related to Iran’s nuclear activities—including the extraterritorial sanctions that, in effect, targeted Chinese entities—will be lifted or suspended, controlled nuclear exports will be permitted, and even restrictions on the provision of arms and missile technology to Iran will be terminated in no more than five and eight years, respectively. And Iran will be actively seeking international partners to help it translate the deal into greater economic and diplomatic clout in its neighborhood and beyond.

For Chinese President Xi Jinping, the Iran deal could not have come at a better time. His “One Belt, One Road” initiative envisionsa chain of energy, infrastructure, and maritime links from East Asia extending to Europe through the Middle East and Central Asia. Iran’s location at the crossroads between these regions makes its participation in the initiative important for Beijing.

For its part, Tehran, unlike Arab states that have been more skeptical of the Chinese initiative, has expressed enthusiasm about the “One Belt, One Road” plan. The Barack Obama administration has been at pains to point out that Iran’s domestic investment needs stand at $500 billion, a sum far greater than the $100 billion to $150 billion in unfrozen assets Tehran is likely to receive once the nuclear deal is implemented. Left unsaid is where the rest of the money will come from. Beijing, which recently pledged to invest $46 billion in an “economic corridor” in Pakistan and tens of billions of dollars to capitalize the new Asian Infrastructure Investment Bank, will likely be happy to chip in. An Iranian deputy minister claimed last year that China had already pledged to double its infrastructure investment in Iran to $52 billion.

Iran is an important supplier of oil for China, but Saudi Arabia remains its top source of crude imports. As these states and Iran contend for regional influence, China could be increasingly pressed to choose sides.

A good deal of that future investment by China may well focus on Iran’s energy sector. Prior to the imposition of oil export restrictions on Iran, Tehran was China’s third-largest supplier of crude; as of 2014, it came in sixth. Even with sanctions lifted, Beijing may hesitate to increase the proportion of its oil imports that comes from Iran out of a concern about becoming too dependent on any single source. Yet China’s upstream investment in the Iranian energy sector may increase nevertheless, in large part to bolster Chinese energy security. Iran is unlikely to be swayed by any future Western political pressure to curtail oil exports to China, and Iran is the only country whose location would allow overland Chinese pipelines to reach the energy-rich Persian Gulf and thus reduce Beijing’s vulnerability to the disruption of maritime chokepoints such as the Straits of Hormuz and Malacca.

TIED UP

As much as Chinese-Iranian economic cooperation may benefit from the nuclear deal, the potential for growth in their strategic ties may be even greater. Iran, confronted by challenging regional crises and seeking to expand its regional influence, will need powerful external partners; the likely candidates are Russia and China, but the latter’s capacity to help far outstrips the former’s.

As a recently released military white paper makes clear, China is seeking to expand its forces’ ability to “effectively secure China’s overseas interests.” This has manifested in Chinese warships’ participation in counterpiracy missions in the region, the People’s Liberation Army Navy’s evacuation of thousands of Chinese nationals from Libya in 2011—the first operation of its kind by China—and Beijing’s reported plan to establish a naval facility in Djibouti. As Beijing seeks to expand its power and influence, Iran is a logical partner. It is the only large, powerful state in the region not already allied with the United States, and it sits astride land and sea routes of vital importance to Beijing. Little wonder, therefore, that in October 2014, the Chinese defense minister publicly expressed Beijing’s desire to expand military ties with Iran (a sentiment Iran has reciprocated by inviting China to expand its naval presence in Iran), and that China’s top counterterrorism official recently visited Iran to seek expanded cooperation against extremists.

A Chinese and Iranian flag can be seen on a table before the start of a media conference with Iran's chief nuclear negotiator Saeed Jalili at the Iranian embassy in Beijing, April 2, 2010. David Gray / Reuters The growth in Sino-Iranian economic and security ties could prove challenging for the United States. China and Iran both appear committed to chipping away at the existing U.S.-led international order. China has established regional security and economic institutions that compete with those dominated by the United States and its allies, and Iran has vocally challenged the authority of the UN Security Council and U.S. hegemony in the Middle East. Furthermore, both enjoy alliances of convenience with Russia, which similarly competes with the United States.

Increased Sino-Iranian cooperation would not be a mere diplomatic nuisance, however. As sanctions on Iran lifted, China has the capacity—through military assistance, economic investment, and the transfer of technology—to facilitate Iran’s rise as a regional power. Given Iran’s record of working through proxies, Chinese assistance could also indirectly strengthen nonstate actors supported by Iran. And Iran can offer China a strategically important foothold in the Middle East, should it choose to challenge U.S. influence there.

But a deeper alliance with Iran could also pose problems for China. Iran is notoriously difficult to work with, even for countries with which it would seem to share interests in common. For example, in April 2014, Iran canceled a $2.5 billion contract with the China National Petroleum Corporation, even as Iranian diplomats were urging the expansion of Sino-Iranian economic ties. Such difficulties may grow as sanctions are lifted and Iran’s alternatives to Chinese firms expand. Another obstacle to Sino-Iranian ties will be Iran’s support for terrorist groups such as Hamas, Palestinian Islamic Jihad, and the Taliban, which Beijing worries could pose a threat to its own interests.

Furthermore, increasing ties with Iran could frustrate China’s efforts to expand its economic partnerships with other regional states, especially Israel and the Gulf Cooperation Council countries, which see Iran as a chief rival. Iran is an important supplier of oil for China, but Saudi Arabia remains its top source of crude imports. As these states and Iran contend for regional influence, China could be increasingly pressed to choose sides.

The U.S. response to deepening Sino-Iranian ties will likely lean heavily on coercive diplomacy—persuading Beijing of the downsides of facilitating Iranian regional behavior, while imposing costs on any Chinese entities that contribute to prohibited Iranian activities such as the provision of arms to proxies. U.S. allies in the region—especially the countries China wants to cultivate as economic partners as part of its “One Belt, One Road” plan—can help influence Beijing’s approach. The context for such actions is also important; the stronger the U.S. alliance system and security architecture in the region, the less likely Iran and China may be to challenge it. And the greater the extent to which China can be persuaded to avoid adopting a zero-sum mindset and instead see the U.S. order as a benefit to its interests, the better.

But what the United States should not do, as it weighs the costs and benefits of the nuclear agreement with Iran, is neglect the accord’s wider implications, which stretch well beyond the battlefields of the Middle East.