Earlier this month, President Donald Trump stopped in Beijing to meet with his “friend,” Chinese President Xi Jinping. At the top of Trump’s agenda was persuading Xi to tighten the economic screws on North Korea, in order to compel Pyongyang to give up all its nuclear weapons. There is nothing inherently wrong with the leaders of great powers developing cordial relations with their counterparts—as long as they bear in mind the dictum of the great 19th-century British statesman Lord Palmerston, who famously said that great powers do not have permanent friends. Instead, they have permanent interests.

Warm personal relationships between leaders may matter at the margins of policy, but national interest always prevails over friendship in determining a state’s foreign policy goals. It’s unclear whether President Trump understands this, or, even more importantly, the reasons why Chinese and U.S. interests clash on some important issues—not least North Korea.

The Xi/Trump meeting did not lead to any breakthroughs on the North Korea issue. For one thing, President Trump is all over the ballpark with respect to North Korea. During his East Asian swing he effectively labeled North Korea a one-country “axis of evil,” warned North Korean leader Kim Jong-un that the U.S. possesses overwhelming military power and is ready to use it, called for Pyongyang to “come to the negotiating table” to solve the crisis peacefully, and said he wants to be friends with Kim.

President Trump is operating on two mistaken assumptions: that North Korea can be compelled to give up all of its nuclear weapons, and that China holds the key to forcing Pyongyang to do so.

China’s leaders have no interest in doing anything that could cause North Korea’s collapse. If the Pyongyang regime dissolved, the Korean peninsula would be reunified, and U.S. troops would be on China’s doorstep. Beijing will do everything in its power—including defending North Korea from a U.S. attack—to prevent this from happening.

Actually, it is the United States—not China—that holds the key to peacefully resolving the crisis without war. Washington needs to acknowledge that both China and North Korea face their own respective “security dilemmas.” To solve the Korea issue without war, the U.S. would need to assuage Beijing’s and North Korea’s respective fears. This would require a radical change in U.S. policy: removing American forces from the Korean peninsula.

That would dramatically reduce Beijing’s and Pyongyang’s sense of insecurity and dramatically change the dynamics with respect to the crisis. Beijing would be able to apply more pressure on North Korea to reach a diplomatic settlement without fear that doing so would have adverse strategic repercussions. And if it no longer needed to fear the U.S. using military power to bring about regime change, the North Koreans would have incentives—especially if economic sweeteners are thrown in—to reduce, and limit, the size of their nuclear arsenal.

Of course, changes in U.S. military posture might solve one problem while creating another: Japan and South Korea would acquire their own nuclear deterrent capabilities. But this is going to happen sooner or later anyway because Japan and South Korea understand that at the end of the day the United States would not commit suicide by using nuclear weapons to defend its “allies.” That is, the U.S. will not—and should not—risk Los Angeles, Houston, or New York to defend Seoul, Tokyo, and Taipei—or, for that matter, Berlin or Warsaw. The U.S. needs to reexamine its policy of “extended deterrence”—that is extending the American nuclear umbrella to cover its allies in East Asia and Europe.

When Xi and Trump met, there was an 800-pound gorilla in the room: the changing Sino-American balance of power. Over the past eight years, China has become the world’s leading exporter, trading nation, and manufacturing nation. And in 2014, the International Monetary Fund announced that, measured by Purchasing Power Parity (PPP), China had leapfrogged the U.S. to become the world’s largest economy.

The U.S. foreign policy establishment downplays the importance of China’s astonishingly rapid economic growth by claiming that “China can’t innovate”—notwithstanding that the compass, printing press, and gunpowder were invented in China. But we don’t need to go back to the ancient Chinese dynasties to see proof of innovation. Over just the past few years, China has taken the lead in quantum communications and green technologies (including electric cars), and built the world’s fastest supercomputer (with chips made in China) and world’s largest radio telescope.

Inside the Beltway, the conventional wisdom is that whatever gains China may be making economically and scientifically, the U.S. lead in military power is unassailable. But some serious American military analysts are rethinking the validity of that assumption. A recent RAND Corporation report (“The U.S.-China Military Scorecard”) talks about the “receding frontier of American military dominance in East Asia.” Other RAND analysts believe that by 2020—regionally, not globally—China will have caught up with the U.S. on most key metrics of military power.

Before our eyes, the tectonic plates of geopolitics are shifting. We are in the midst of a truly world historical event: what scholars of great power politics call a power transition. Power transitions occur when the dominant (hegemonic) great power’s primacy is challenged by a rising great power.

The Sino-American relationship today is a textbook example of a power transition, and it bears many similarities to the pre-1914 Anglo-German rivalry that culminated in World War I. Power transitions are the most dangerous moments in great power politics because they invariably lead to war between the incumbent hegemon and the rising challenger.

The geopolitical question of our time is whether the United States will try to maintain an East Asian balance of power that is out of sync with the emerging power realities in the Sino-American relationship.

“May you live in interesting times” is an ancient Chinese curse. We are living in just such times. Avoiding a Sino-American clash in coming years will require U.S. policymakers to engage in long-term, sober, and innovative strategic thinking.

Christopher Layne is University Distinguished Professor of International Affairs at Texas A&M University. His essay on the parallels between the pre-1914 Anglo-German power transition and the current Sino–American relationship will be published in January 2018 in the edited volume Will China’s Rise Be Peaceful?