President Trump’s “phase one” trade deal with China is largely a victory for Beijing. Just measure the agreement signed this week against the initial demands made by Washington in a leaked May 2018 document. As the Financial Times concludes, with regard to the central U.S. goals, “After almost two years of negotiations, tariffs and counter-tariffs, Mr. Trump has achieved none of these objectives.”

This outcome is partly a reflection of the two sides’ staying power. China is a one-party state that can take the long view. Trump gambled that he could hurt the Chinese economy enough with tariffs that the pain to American consumers — who have paid for those tariffs — would be worth it. But the president apparently decided that he wanted to smooth the economic waters as he runs for reelection. So he folded.

From a broader perspective, however, this trade deal reflects something new on the international landscape, something the United States is going to have to grapple with for decades. As I argue in Foreign Affairs, China is the first real peer competitor that the United States has faced in the modern era. (Even the Soviet Union was never really an economic peer.)

China is the world’s second-largest economy. It is the largest trading partner of most countries in Asia and many others around the world, holds the world’s largest foreign exchange reserves, and leads the world in many industries — including high-tech sectors such as 5G.

Perhaps more significantly, it is not part of the American security system. Washington has faced an extraordinarily benign international environment in one key respect. After World War II, the countries that emerged (or reemerged) to wealth and power were all, bluntly, U.S. protectorates — Germany, France, Britain, Japan, South Korea. China is most decidedly not.

Add to this a very different political system and cultural background, as well as a desire to project power in Asia and beyond, and you have the makings of a complex and tense relationship. But as Trump’s failed negotiations demonstrate, this is not a case where threats, confrontation and bluster will always work. China, too, has leverage.

Trump’s chief mistake was to go it alone. European leaders offered to join forces with the United States against China — together representing almost 50 percent of global gross domestic product and more than 50 percent of international military spending. Trump declined, instead castigating Europe for running trade deficits with the United States. He also withdrew from the Trans-Pacific Partnership, an agreement that would have put pressure on China.

On this issue, the fault does not lie solely with Trump. Democrats have turned equally hawkish on China and protectionist in general. The president’s deal is being criticized by all the leading lights of the party, but had a Democrat been in the White House, the outcome probably would not have been very different.

Critics are correct that Beijing has played fast and loose with the rules of free trade. But fundamentally, China owes its prosperity to the switch from communist economics to a more market-based approach. It has boomed because the Chinese work hard, save and invest heavily, and have borrowed good ideas. The best way to respond to China’s rise would be for Washington to make major investments in science, technology, infrastructure and job training that will ensure the United States can out-innovate and out-compete anyone.

The geopolitical threat of a rising China is poorly understood, often prompting knee-jerk references to another Cold War. A comparison might help. Forget the Soviet Union and look at Russia today, as it tries to degrade the open international order that the West has forged since 1945. China is trying to grow rich and powerful within that order. China is not a rogue nation like Russia, seeking to interfere in Western democracy and invade its neighbors. As I noted in Foreign Affairs, China under Mao Zedong used to be a leading sponsor of revolutionary insurgencies throughout the world. It is now the second-largest funder of U.N. peacekeeping. In fact, Beijing has not gone to war since 1979, a record of nonintervention that makes it unique among the permanent members of the U.N. Security Council.

The United States is going to compete with China for the bulk of the 21st century. But it will have to do it wisely, enlisting allies and trying to keep the competition within the international system. If, instead, we go down the path of confrontation and containment, this struggle would destroy the open international order and the open global economy. We would end up with government controls on trade, technology and travel, a ceaseless struggle for allies and influence, lower levels of economic growth and the dangers of a nuclear arms race and even war. With China, the challenge is not how tough you can be but how smart.

Read more: