In the past 25 years, war has claimed too many lives. Yet even as civil and religious strife has raged in Syria, Central Africa, Afghanistan and Iraq, a devastating clash between the world’s great powers has remained almost unimaginable.

No longer. Last week, the Pentagon issued a new national defense strategy that put China and Russia above jihadism as the main threat to America. This week, the chief of Britain’s general staff warned of a Russian attack. Even now America and North Korea are perilously close to a conflict that risks dragging in China or escalating into nuclear catastrophe.

Powerful, long-term shifts in geopolitics and the proliferation of new technologies are eroding the extraordinary military dominance that America and its allies have enjoyed. Conflict on a scale and intensity not seen since World War II is once again plausible. The world is not prepared.

The pressing danger is of war on the Korean Peninsula, perhaps this year. President Donald Trump has vowed to prevent Kim Jong Un, North Korea’s leader, from being able to strike America with nuclear-armed ballistic missiles, a capability that recent tests suggest he may have within months, if not already. Among many contingency plans, the Pentagon is considering a disabling pre-emptive strike against the North’s nuclear sites. Despite low confidence in the success of such a strike, the military must be prepared to carry out the president’s order should he give it.

Even a limited attack could trigger all-out war. Analysts reckon North Korean artillery can bombard Seoul, the South Korean capital, with 10,000 rounds a minute. Drones, midget submarines and tunneling commandos could deploy biological, chemical and even nuclear weapons. Tens of thousands would perish — many more if nukes were used.

The Economist has argued that the prospect of such horror means that, if diplomacy fails, North Korea should be contained and deterred instead. Although we stand by our argument, war is a real possibility. Trump and his advisers may conclude that a nuclear North would be so reckless, and so likely to cause nuclear proliferation, that it is better to risk war on the Korean Peninsula today than a nuclear strike on an American city tomorrow.

Even if China stayed out of a second Korean war, both it and Russia are entering into a renewal of great-power competition with the West. Their ambitions will be even harder to deal with than North Korea’s. Three decades of unprecedented economic growth have provided China with the wealth to transform its armed forces and have given its leaders the sense that their moment has come. Russia, paradoxically, needs to assert itself now because it is in long-term decline. Its leaders have spent heavily to restore Russia’s hard power, and they are willing to take risks to prove they deserve respect and a seat at the table.

Both countries have benefited from the international order that America did most to establish and guarantee. But they see its pillars — universal human rights, democracy and the rule of law — as an imposition that excuses foreign meddling and undermines their own legitimacy. They are now revisionist states that want to challenge the status quo and look at their regions as spheres of influence to be dominated. For China, that means East Asia; for Russia, Eastern Europe and Central Asia.

If America allows China and Russia to establish regional hegemonies, either consciously or because its politics are too dysfunctional to respond, it will have given them a green light to pursue their interests by brute force. When that was last tried, the result was World War I.

What should America do? Almost 20 years of strategic drift have played into the hands of Russia and China. Former President George W. Bush’s unsuccessful wars were a distraction and sapped support at home for America’s global role. Former President Barack Obama pursued a foreign policy of retrenchment and was openly skeptical about the value of hard power. Today, Trump says he wants to make America great again, but he’s going about it in exactly the wrong way. He shuns multilateral organizations, treats alliances as unwanted baggage and openly admires the authoritarian leaders of America’s adversaries.

It is as if Trump wants America to give up defending the system it created and to join Russia and China as just another truculent revisionist power instead.

America needs to accept that it is a prime beneficiary of the international system and that it is the only power with the resources to protect it from sustained attack. The soft power of patient and consistent diplomacy is vital, but must be backed by the hard power China and Russia respect. America retains plenty of that hard power, but it is fast losing the edge in military technology that inspired confidence in its allies and fear in its foes.

America needs to invest in new systems based on robotics, artificial intelligence, big data and directed-energy weapons. Belatedly, Obama realized that America required a concerted effort to regain its technological lead, yet there is no guarantee that it will be the first to innovate. Trump and his successors need to redouble the effort.

The best guarantor of world peace is a strong America. Fortunately, it still enjoys advantages. It has rich and capable allies, still by far the world’s most powerful armed forces, unrivaled war-fighting experience, the best systems engineers and the world’s leading tech firms. Yet those advantages could all too easily be squandered. Without America’s commitment to the international order and the hard power to defend it against determined and able challengers, the dangers will grow. And the future of war could be closer than you think.

Copyright 2013 The Economist Newspaper Limited, London. All Rights Reserved. Reprinted with permission.