After decades of ideologically based hostility, the United States and China found common ground on an economic relationship that, while bumpy, served the larger interests of both countries.
But now, China is undergoing a rough transition, both economic and political. And that means difficult adjustments ahead for Washington and Beijing, setting the scene for Chinese President Xi Jinping's first state visit to the nation's capital Thursday.
The recent crash in Chinese stocks and the government's abrupt currency devaluation, which have sparked turmoil in global markets, are only the most dramatic signs of tectonic shifts that are occurring beneath the surface in the world's second-largest economy and its most populous nation.
Beijing is in the midst of a major economic transition away from manufacturing and into a service-based economy. That shift is necessary if China is to become a stable middle-class nation, but the current financial market chaos shows it's not likely to be pain-free.
Moreover, Beijing's attempt to create a modern, Western-style, free-market economy while maintaining an authoritarian — and often corrupt and self-serving — political system faces major challenges. The consequences of that internal tension and upheaval are likely to be felt far beyond China's borders.
Already the climate for American businesses has become more difficult. Surveys of U.S. and other Western businesses in China indicate they are finding it increasingly difficult to access the country's large markets, hamstrung by protectionist policies and even investigations of foreign firms.
"The barriers China is throwing up are becoming more serious," particularly in areas of advanced technology, said Yukon Huang, a senior associate at the Carnegie Endowment for International Peace in Washington.
With U.S. exports down and the Chinese economy slowing, he said, "the situation has gotten more complicated and tenser."
What made the economic relationship work for the United States for so long was China's ability to provide cheap manufactured goods and, later, its huge appetite for American-made products as varied as airliners and disposable diapers. For its part, China got American investments and technical know-how to build its own economic colossus.
Now profound changes in China are shaking the foundations of that relationship. China's move into a consumer-driven society presents potentially lucrative opportunities for the U.S. to use its strength in sophisticated technology and services that include health, finances and entertainment — but only if they're open to fair competition.
At the same time, China's growing wealth and strength are leading naturally to seeking a more dominant role in the region, which has manifested itself in increasing tensions over territorial island claims with Japan, Vietnam and the Philippines.
U.S.-China relations have been strained further by Washington's allegations of Chinese hacking, or cyberattacks, on U.S. government and business systems.
"This is going to be a very blunt meeting between Xi and Obama," said David Bachman, a China expert at the University of Washington in Seattle.
Xi began his U.S. visit this week in Seattle, where he sought to reassure American businesses that Beijing would press on with economic reforms and protect the rights of foreign investors.
In deals signed during his visit this week, Chinese companies agreed to buy 300 Boeing jets and build the airliner's first assembly plant in China. But those deals, similar to previous orders made during Chinese presidential visits, do not address the broader concerns of American businesses.
Xi last visited the White House in 2012 as China's vice president. Then the Chinese economy seemed to be steaming ahead, albeit a little more slowly, while the U.S. was struggling with sluggish growth. The tables have since turned.
U.S. exports to China account for less than 1% of the American economy, so it isn't so vulnerable on trade. But for years China has been one of the biggest buyers of U.S. Treasury bonds, and more recently Chinese investors have been gobbling up American houses and other real estate, particularly on the West Coast.
Although many think the concerns about Chinese growth are overblown, the problems have unnerved global markets for weeks and were enough for the Federal Reserve last week to put off making a long-anticipated decision to begin raising interest rates in the United States.
"The question is whether or not there might be a risk of a more abrupt slowdown than most analysts expect," Fed Chairwoman Janet L. Yellen said of the Chinese economy.
With its opaque statistical reporting and government-controlled media, nobody can be sure whether China is growing 7% this year, as Beijing has stated. One thing is clear, however: Its days of double-digit growth are long gone. And as China shifts, so must the world — and that goes for the U.S., too.
In his meeting with Xi, President Obama can be expected to push for greater transparency and a level playing field for American companies. Some analysts argue that with Xi on his heels after Beijing's questionable steering of the economy, now is the time for Obama to press for more from China.
"A warm welcome at the White House would bolster Xi's standing at home. And for that, the U.S. could demand something in return," said Wallace Chen, the China program director at the International Center for Trade and Sustainable Development in Geneva.
The summit's economic agenda will include familiar issues of importance to America's interests such as currency and protection of intellectual property.
The U.S. and China have been working on a bilateral investment treaty, but that deal has practically no chance of being completed before Obama leaves office, said Robert Theleen, chairman of the American Chamber of Commerce in Shanghai.
Reports from the Shanghai chamber and other groups indicate that U.S. companies largely are still doing well in China.
The U.S.-China Business Council, a group that represents more than 200 firms doing business in China, said 41% of its member companies reported a double-digit gain in China sales last year. But that's down from 65% in 2010, and their profit margins are getting squeezed, said the council's president, John Frisbie.
"There's a clear trend of moderating expectations," he said.
Obama's approach in dealing with a rising China has involved a policy of both engagement and containment. His administration has continued and expanded the annual high-level strategic dialogue first established under President George W. Bush, as well much longer-running joint talks focused on trade.
At the same time, Obama has sought to galvanize support in Asia through the Trans-Pacific Partnership free-trade deal and other means to curb China's power and influence.
Analysts say Chinese tensions over the economy and party control could contribute to Beijing's increasingly assertive role offshore, making it more difficult to resolve regional conflicts involving Chinese claims to islands.
Stirring nationalism and xenophobia is a time-honored way to distract the citizenry from unhappy developments at home. And an economically embattled Beijing, experts said, is not likely to pull in its horns in foreign policy, especially close to home.
Historically, Chinese leaders have tended to see internal and external challenges coming together, said the University of Washington's Bachman. The Tiananmen Square uprising in 1989, for example, ignited fears that foreigners were taking advantage of China's weakened position.
"For China, it's the thinking that if we have domestic troubles, we better watch out for what the foreigners are doing," he said.