Just months ago, world leaders were fretting over the threat posed by an increasingly assertive China.
The country's government oversaw the worst crackdown on dissent in nearly three decades. The Chinese built, then militarized, islands in disputed waters of the South China Sea. They tightened controls over the Internet, freezing out foreign firms while allowing their domestic competitors to prosper.
Then the United States elected Donald Trump as president.
Now some of those same countries are looking to Beijing to defend international cooperation on matters as diverse as trade and climate change, propelling China to new heights on the world stage.
And yet China doesn't sound particularly enthused about its elevation.
The Global Times, a Communist Party mouthpiece, this week called it "beyond imagination to think that China could replace the U.S. to lead the world."
The 21st Century Business Herald, China's leading business newspaper, referred to the country as "a promoter, a reformer, not a revolutionary."
China "wants to be a force of stability," said Min Ye, an associate professor at Boston University's Frederick S. Pardee School of Global Studies. "But it's not into changing the global order. It's a big responsibility … China still sees itself as a growing power."
China, whose leaders' greatest concern is domestic stability, is also battling a slowing economy and rampant income inequality at home.
"Factor one is whether China has the capacity to be leader, and factor two is whether China has the willingness to be leader," said Chen Dingding, professor of international relations at Jinan University in Guangzhou.
"If the U.S. — No. 1 power — not interested in global leadership, why should China be?"
The election of a U.S. president who takes an inward and sometimes contradictory approach to foreign policy has already handed China major geopolitical wins, analysts say.
The president-elect's vow to block President Obama's signature trade pact, the Trans-Pacific Partnership, or TPP, has drawn some countries closer to China's economic orbit.
Malaysia, once a backer of the 12-nation free trade deal, is shifting its focus to a Chinese alternative, the Regional Comprehensive Economic Partnership. Vietnam recently decided not to ratify the U.S.-backed agreement, leaving an opening for China's pact. Even longtime American ally Australia plans to seek out other trade options.
Obama saw the TPP — which excluded China — as vital to expanding America's influence in the region. China considered it a blatant attempt to contain its growing economic and political clout.
Trump's dismissal of the pact "leaves a gap," said Claire Reade, a senior associate at the Center for Strategic and International Studies in Washington. "Is China going to walk into that gap to encourage regional and global integration? I think the answer is yes."
The region's pivot toward China on economic matters hurts the United States' ability to shape developments on the political front. The U.S. typically ties its international aid and loans to causes such as gender equality, government transparency and human rights — issues on which China's authoritarian leaders rarely engage.
"U.S. hegemony is not great, but it's the best hegemony we've had in a long time," said David Zweig, a Canadian who researches Sino-American relations at the Hong Kong University of Science and Technology.
China has reason to defend globalization.
Although Beijing has chafed at perceived U.S. incursions, including criticism of its human rights record and U.S. naval operations in the South China Sea, it has benefited greatly from closer economic cooperation with the rest of the world. The struggling country that entered the World Trade Organization in 2001 has grown into the world's second-largest economy.
While Trump has been promoting his "America first" platform, China has sought to reassure world leaders about its reliability and consistency on international matters.
"China will not shut the door to the outside world but will open it even wider," Chinese President Xi Jinping said Nov. 20 at the Asia-Pacific Economic Cooperation summit in Peru.
Vice Foreign Minister Liu Zhenmin last week dismissed Trump's assertion that climate change is a "hoax" invented by China to destroy U.S. competitiveness and pledged to defend a landmark agreement to fight global warming "whatever the circumstances."
This year, China opened the Asian Infrastructure Investment Bank, a Beijing-based rival to the World Bank and International Monetary Fund. The country has also greatly expanded its "One Belt, One Road" initiative, which aims to revive ancient Silk Road trade routes by building roads, ports and other infrastructure across Asia, Europe and North Africa.
Nations far outside China's regional sphere of influence are paying heed.
In 2012, China struck a deal with 16 Central and Eastern European countries to deepen economic, tourism and education ties.
That framework has encouraged Eastern European countries to see China as "sort of a savior" in difficult economic times, when there is a need for investment that the West cannot provide, said Anastas Vangeli, a sociologist at the Polish Academy of Sciences.
China's economic rise, combined with the shock of the recent global financial crisis and the wave of populism now sweeping the U.S. and Europe, has some people in the region questioning the virtues of Western-style democracy.
"When you take a lot of people who don't know much about China, and you show them snatches of Beijing and Shanghai, they get fascinated with it," Vangeli said. "Often in their statements, they say things like, 'Maybe China got some things right.'"
For more news from Asia, follow @JRKaiman on Twitter
Meyers is a special correspondent. Nicole Liu in The Times' Beijing bureau contributed to this report.