As China grows more powerful, it is displacing decades-old American preeminence in parts of Asia. The outlines of the rivalry are defining the future of the continent.

We asked a panel of experts how they think the power has shifted in the past five years:

Many countries are shifting toward China and away from the traditional American-led order. NORTH KOREA SOUTH KOREA JAPAN CHINA BHUTAN NEPAL But some countries are still working to counteract China. PAKISTAN BANGLADESH INDIA TAIWAN MYANMAR LAOS THAILAND PHILIPPINES VIETNAM And others are hoping to play both sides. CAMBODIA SRI LANKA MALAYSIA INDONESIA AUSTRALIA Many countries are now shifting toward China. But some are still counteracting China. N. KOREA JAPAN S. KOREA BHUTAN CHINA NEPAL PAK. BANG. INDIA TAIWAN MYAN. LAOS VIET. PHILIPPINES THAILAND And others are playing both sides. CAMB. SRI LANKA MALAYSIA INDONESIA AUSTRALIA But some countries are still working to counteract China. Many countries are now shifting toward China. N. KOREA JAPAN S. KOREA CHINA NEPAL PAK. BANGL. INDIA TAIWAN MYAN. LAOS PHILIPPINES THAILAND VIETNAM CAMB. And others are hoping to play both sides. SRI LANKA MALAYSIA INDONESIA AUSTRALIA Many countries are shifting toward China. N. KOREA S. KOREA JAPAN CHINA BHUTAN NEPAL PAKISTAN But some countries are still working to counteract China. BANGLADESH INDIA TAIWAN MYANMAR LAOS PHILIPPINES THAILAND VIETNAM And others are hoping to play both sides. CAMBODIA SRI LANKA MALAYSIA INDONESIA AUSTRALIA

Last week, a group of 11 nations signed a trade deal that had originally been conceived as an American-led counterweight to China — but after President Trump pulled out, the pact went forward without the United States. It was the latest turn in Asia’s gradual transition from American dominance to something much more fluid.

The stakes could hardly be higher: The two powers are seeking to reshape the economies and political systems of the world’s most populous region in its own image.

The United States’ military capabilities still dominate Asia. But China has started to wield growing military power and economic leverage to reorder the region, pulling longtime American allies like the Philippines and Indonesia closer.

The shift may accelerate under President Trump, whose volatile foreign policy and rejection of trade agreements is already forcing Asian nations to rethink their strategies.

The trade deal reached last week is a powerful signal of how countries like Australia and Japan are forging ahead without American leadership. The deal replaces the Trans-Pacific Partnership, which Mr. Trump had effectively killed.

Every Asian country now trades more with China, often by a factor of two to one, an imbalance that is only growing as China’s economic growth outpaces that of United States.

How trade has shifted toward China More trade with U.S. More trade with China 2011 2016 Myanmar Cambodia Vietnam Laos Taiwan Malaysia South Korea Thailand Australia Nepal New Zealand Pakistan Indonesia Bangladesh Philippines Japan Sri Lanka Bhutan India 0 10% 5 5 10 More trade with U.S. China 2011 2016 Myanmar Cambodia Vietnam Laos Taiwan Malaysia South Korea Thailand Australia Nepal New Zealand Pakistan Indonesia Bangladesh Philippines Japan Sri Lanka Bhutan India 0 10% 5 5 10 The difference in total trade as percentage of G.D.P. between each country and China and each country and the United States. Sources: World Bank; Ministry of Finance of Bhutan; Ministry of Finance of Taiwan and the International Monetary Fund. The most recent data for Vietnam, Thailand, Nepal and Bangladesh is from 2015.

Asian leaders know that their economies – and therefore, domestic politics – rely on Beijing, which has shown it will offer investment to friends and economic punishment to those who displease it.

But another metric of great power influence, arms sales, shows United States’ enduring reach.

U.S. arms sales still dominate Asian markets Arms sales by U.S. China Australia $3,789 million South Korea 3,626 Taiwan 2,953 India 2,782 Singapore 2,420 Japan 1,666 Pakistan 1,005 3,656 Indonesia 447 279 Philippines 261 Thailand 229 131 New Zealand 136 Bangladesh 1,666 110 Brunei 87 Malaysia 22 Sri Lanka 10 Laos 31 Cambodia 54 Myanmar 1,161 Arm sales by U.S. China Australia $3,789 million South Korea 3,626 Taiwan 2,953 India 2,782 Singapore 2,420 Japan 1,666 Pakistan 1,005 3,656 Indonesia 447 279 Philippines 261 Thailand 229 131 New Zealand 136 Bangladesh 110 1,666 Brunei 87 Malaysia 22 Sri Lanka 10 Laos 31 Cambodia 54 Myanmar 1,161 Source: Stockholm International Peace Research Institute. Figures are SIPRI estimates of total production costs from 2011 to 2016.

Countries that purchase American weapons bind their militaries and their foreign policies to the United States. The imbalance reflects the extent of American military relationships in Asia, which date back to World War II.

Many of the 20 countries caught between Beijing and Washington face an impossible choice between Chinese wealth and American security.

“These countries don’t want to have to choose sides,” said Tanvi Madan, an Asia specialist at the Brookings Institution.

So they’re not. Instead, most are pursuing strategies intended to draw maximum benefit from both powers, minimize risks of angering either and preserve their independence.

The result will likely be something very different from Cold War-era Europe, which was divided cleanly between two sides. Instead, the continent will fracture along many lines at once as countries accept, reject or manage China’s growing influence.

Each strategy involves hard compromises and provides a model for how others in Asia, and perhaps one day globally, will cope with a Chinese-American world.

Balancing Against China: Japan

CHINA NORTH KOREA SOUTH KOREA JAPAN Japan is organizing an anti-China bloc. CHINA N. KOREA S. KOREA JAPAN Japan is organizing an anti-China bloc. CHINA NORTH KOREA SOUTH KOREA JAPAN Japan is organizing an anti-China bloc.

Though the world is changing in Beijing’s favor, Japan is a reminder that China remains a long way from becoming an American-style power. And it provides a template for counteracting China.

Japan is matching China’s rise with its own resurgence, leveraging its economy — the world’s third-largest — to build an independently powerful military and set of diplomatic relationships. It is attempting to reconstitute an informal and implicitly anti-Chinese alliance known as “the quad,” which includes India, Australia and the United States.

The “quad” remains mostly aspirational, and its members so far exert only a fraction of China’s economic and military influence in the region.

Still, Japan represents the headwinds facing Beijing. Asia’s largest economies and its leading democracies, rather than bending to Chinese power, are counterbalancing against it.

Most countries lack Japan’s economic power, but they can still follow its lead. Rather than meekly accepting American withdrawal, Japan shows how countries can compensate for it.

The region has more bad news for China. Even its sole ally, North Korea, is increasingly independent. Its nuclear and missile tests often appear timed to humiliate Beijing, and give China’s adversaries like Japan an excuse to build up their militaries. North Korea apparently hopes to one day strike a deal with Washington, allowing it to climb out from a half-century of Chinese dominance. If Beijing cannot keep even North Korea as a client state, it will have trouble cultivating others.

Aligning with China: Sri Lanka

CHINA BHUTAN NEPAL PAKISTAN INDIA BANGLADESH China is drawing a circle of allies around India, including Sri Lanka. SRI LANKA CHINA NEPAL PAKISTAN BHUTAN INDIA BANGLADESH China is drawing a circle of allies around India, including Sri Lanka. SRI LANKA CHINA NEPAL BHUTAN PAKISTAN INDIA BANGLADESH China is drawing a circle of allies around India, including Sri Lanka. SRI LANKA

Sri Lanka might not seem like a geopolitical bellwether. But Asia-watchers have been glued to developments here since 2014, when a Chinese submarine sailed into a port built with Chinese investment. It marked a new era, in which China is converting its economic power into military power — and, in poorer democracies, into political influence.

China has since developed more infrastructure projects across Asia, particularly in strategically vital ports and transit corridors. Those projects begin as joint developments but can end up in Chinese hands. In December, Sri Lanka, unable to pay debts on the port’s construction, granted China a 99-year lease.

“The Chinese are using their abundance of labor, capital and workforce to project their influence,” said Mira Rapp-Hooper, a scholar of Asian security issues at Yale Law School. She added, “It’s mostly taking place in countries where the U.S. does not have a lot of influence or give a lot of aid.”

This a promising model for China, whose economic strengths naturally fit the needs of small, developing countries. It is even pushing in countries where the United States has spent heavily, such as Pakistan. And it is slowly extending this model beyond Asia, giving it the outlines of what could one day be a global network.

But small, poor allies are less powerful than rich ones, which tend pro-American, and Beijing can be clumsy when dealing with democracies.

Still, China’s success in South Asia shows it can hem in a powerful adversary. It is leveraging trade and investment to build ties with every country on India’s border. Beijing’s unstated goal: encircle India before it can rival to Chinese power. While India is taking a harder line against China, it is less practiced in regional alliance-building and has fallen behind.

Hedging Between the Powers: the Philippines

CHINA Countries like the Philippines are playing the U.S. and China off one another. MYANMAR LAOS THAILAND VIETNAM CAMBODIA PHILIPPINES MALAYSIA INDONESIA AUSTRALIA Countries like the Philippines are playing the U.S. and China off one another. CHINA MYANMAR LAOS VIETNAM THAILAND CAMB. PHILIPPINES MALAYSIA INDONESIA AUSTRALIA Countries like the Philippines are playing the U.S. and China off one another. CHINA MYANMAR LAOS THAILAND VIETNAM CAMB. PHILIPPINES MALAYSIA INDONESIA AUSTRALIA

Many Asian leaders are eluding the great powers by hedging between them. Few have done so as creatively and brazenly as President Rodrigo Duterte of the Philippines.

Upon taking office in 2016, Mr. Duterte suggested that he might end his country’s 65-year alliance with the United States. He rushed to Beijing, promised cooperation with China and – as if to signal there was no going back – crudely insulted then-President Barack Obama.

Instead, Mr. Duterte ended up collecting concessions from both powers. The Americans reduced Mr. Duterte’s obligations to the alliance while continuing to guarantee his country’s defense. The Chinese offered Mr. Duterte favorable terms on maritime disputes and possible investment deals.

He never did switch sides.

Such stories have played across Southeast Asia, where China has been at its most confrontational. Beijing had hoped that it could coerce smaller countries to accept its dominance. Washington thought it might galvanize an anti-Chinese bloc. Nearly every country has found a middle path.

Even Vietnam, a traditional Chinese adversary, has resisted both Chinese influence and American overtures. Almost two years after President Obama lifted his country’s arms embargo on Vietnam, hoping to bring it into the American fold, it still buys most of its arms from Russia.

But China’s leverage in the region can only grow, particularly if the United States continues withdrawing. Ms. Rapp-Hooper called attention to growing scandals in Australia and New Zealand over Chinese influence-buying.

“These countries could not be more aligned with our interests, but there is still a lot of discomfort about stepping away from Chinese money,” she said. “Those are tests of what we’re up against.”