Melinda Liu has reported in China for more than two decades and has been based in the Chinese capital since 1998 as Newsweek's Beijing Bureau Chief.

BEIJING—Barack Obama just won’t stop “pivoting” to Asia—he’s still at it this week—and China can hardly keep up. Even in his final months in office, the U.S. president continues to drop surprise moves on Beijing—whether it was “tarmac-gate,” when Obama decided to exit Air Force One from an unexpected doorway after a delay at the airport last Friday, touching off a shouting match between Chinese and U.S. officials, or the four whole days that Obama decided to spend in a country no U.S. leader had ever visited before and which no one even in Asia pays much attention to, landlocked Laos.

The president pledged $90 million to the Laotians to clean up some 80 million Vietnam-era stray unexploded bombs, and he sought to heal old wounds from the secret nine-year U.S. war in Laos by empathizing with “Laotians who have continued to live under the shadow of war" and lamenting that most Americans know little about the country or their own role in its history—comments that Obama’s critics at home will no doubt characterize as another “apology tour.” But the critics miss the point. By opening up new relationships in East Asia, Obama clearly intends to leave behind the legacy of a strong American presence on China’s periphery—and practically the only obstacle standing in his way is back in Washington, where his Trans-Pacific Partnership is in trouble on Capitol Hill. Moreover, in five months Obama could well be followed in office by Hillary Clinton, who has been even tougher on China than her former boss has.


Bottom line: The Chinese leadership is plainly worried about growing U.S. influence in the region. Contrary to the cynics in Washington who tend to see Obama’s “Asia Pivot” as mostly rhetoric—and Donald Trump, who mocked Obama over tarmac-gate on Monday, saying it was “a sign of such disrespect” from Beijing—the Chinese have come to fear and fret over the moves made by the soon-to-be-lame-duck U.S. president. In recent months, Beijing has watched its clout diminish in neighboring countries courted by the Americans such as Laos, Vietnam and Myanmar. Beyond that, much of China’s claim to disputed South China Seas islands was dismissed by a UN arbitration tribunal in the Hague – a ruling that Chinese Foreign Minister Wang Yi called “a political farce made under the pretext of law.” (Back in 2010, Southeast Asian representatives gathered in Hanoi expressed concern about Chinese maritime claims and then-Secretary of State Hillary Clinton declared it a U.S. “national interest” to uphold freedom of navigation in the South China Sea. China’s Foreign Minister at the time, Yang Jiechi, furiously warned against “outside” meddling and declared “China is a big country and other countries are small countries, and that’s just a fact.”

In contrast, Beijing’s rhetoric sounds calmer now—one might even say chastened. On the eve of the G20, former ambassador and senior foreign-affairs expert Fu Ying published a Bloomberg commentary that struck China-watchers as more conciliatory in tone. While not relinquishing Beijing’s core positions, she wrote, “Hopefully, given the fierce debate over the tribunal's verdict, people in the region will again see the wisdom of dealing with such issues through friendly dialogue rather than confrontational means.”

From the start, Chinese officials have under-estimated Obama. When he was running for president, most Chinese foreign-policy gurus predicted he could never win – because Americans were too racist to tolerate a black president, they said. When Obama did get elected, many of those same Chinese experts on American affairs declared he wouldn’t last; a few predicted he’d be assassinated within months of taking office. Obama not only proved them wrong, but he also re-focused U.S. policy energies on the so-called pivot or “rebalancing” towards Asia. While it may not have achieved all that the White House intended, America and its allies have pushed back against Chinese muscle-flexing in the Pacific, leading to setbacks in Beijing’s territorial and diplomatic ambitions.

In July, Washington and Seoul agreed to deploy the U.S. Terminal High-altitude Area Defense (THAAD) missile system in South Korea to counter Pyongyang’s nuclear threat – a move that is straining relations between Beijing and Seoul, a stalwart U.S. ally. The U.S. military has sent more planes and ships to the Philippines, another longtime U.S. ally (despite the strange brouhaha at this week’s ASEAN summit, when outspoken Philippine President Rodrigo Duterte insulted Obama), and increased U.S. troop deployments in Guam. The Pentagon plans to have three-fifths of its air and naval assets in the Pacific by 2020, cited Admiral Harry Harris, commander of U.S. military forces in the Pacific and a critic of China’s construction of what he called “A Great Wall of Sand” in the disputed Spratly Islands.

“It’s on China not to be isolated. … It’s on them to conduct themselves in ways that aren’t threatening, that aren’t bullying, that aren’t heavy-handed with smaller countries,” said the admiral, who maintained that “the idea of the rebalance [towards Asia] has taken hold.”

***

In recent months, Beijing has also jockeyed intensively for power against Washington and its allies in Asia. That may be one reason the mood was so tense even as Obama touched down in Hangzhou for the G20 meeting hosted by Chinese President Xi Jinping. After Air Force One landed, Obama didn’t walk down a mobile staircase bedecked with red carpet, as other presidents had. Instead, he exited from a utilitarian fold-down metal staircase in the belly of the plane. (The glitch resulted after the Chinese initially refused U.S. requests to use an English-speaking driver for the mobile air-stairs, then relented – but by then it was too late.) U.S. and Chinese officials were then witnessed yelling at each other on the tarmac, arguing over where American reporters could stand; even National Security Advisor Susan Rice momentarily found her way blocked by local authorities. “This is our country!” declared one agitated Chinese official in English to his U.S. counterpart, “This is our airport!” On social media, Chinese bloggers blamed stringent U.S. security procedures for the glitch. “Your plane landed on our Chinese territory!” declared a Chinese blogger on Weibo, “You have to follow our rules.”

Western headlines seized on the Chinese “snub” to Obama, as did Trump—who to the delight of the Hillary Clinton campaign raised more questions about his temperament when he declared that after tarmac-gate he would have just called off the G20 and gone home. But the U.S. president cautioned American media to not “over-crank the significance” of the airport fracas.

At the G20, some of the Asia tensions were papered over. China and the U.S. announced they’d both ratify the Paris accord to curb climate-warming emissions. Xi and Japanese Prime Minister Shinzo Abe met for the first time in more than a year, shook hands, and murmured polite phrases at each other despite smoldering maritime disputes in the East China Sea. However in a meeting with South Korean President Park Geun-Hye, Xi warned that the recent U.S. deployment of an anti-missile system in her country “could intensify conflicts” in light of Pyongyang’s belligerent behavior. On cue, near the close of the conference the reclusive North Korean regime did what it could to spoil the party by firing three missiles into the nearby Sea of Japan. It was a sobering reminder of the threat posed by Pyongyang—and a deep embarrassment to North Korea’s neighbor and ally, China.

But on the whole, Obama has been pushing somewhat successfully to counter the nagging perception that America is turning inward and away from globalization—largely thanks to resistance to the TPP from both sides in the 2016 presidential campaign. (An issue that the U.S. administration has also made about China; it's no accident that Obama's trade representative, Michael Froman, recently warned Congress that opposing the TPP—which doesn't include China—means "handing the keys to the castle to China”on trade.) And the representatives of U.S. allies in the region had cause to celebrate in Hangzhou after the Permanent Court of Arbitration tribunal in the Hague ruled against Beijing and in favor of the Philippines regarding South China Sea islands claimed by a handful of governments, including Beijing and Manila. Chinese troops have been building runways and other constructions to back up its own claims. But the tribunal deemed them mostly “without legal basis.” Beijing refused to take part in the arbitration and declared its verdict “null and void” – but in private Chinese scholars acknowledged that Beijing’s failure to take the Philippine lawsuit seriously now seemed like a blunder.

The one odd setback to Obama’s charm tour came when Duterte, the Philippine president, vowed in May not to “antagonize China” and said he preferred to discuss the South China Sea issue quietly and directly with Beijing without involving other ASEAN members—an approach Xi’s regime prefers. Then, last week, a reporter asked about a planned meeting between Obama and Duterte in Laos—the first between the two leaders since the Hague ruling—and questioned whether Duterte’s brutal “war on drugs,” a controversial campaign that encourages vigilante-style executions of drug dealers and addicts, would come up. “Who is he to confront me?” blustered Duterte. “We have long ceased to be a [U.S.] colony.” Should Obama raise the topic, he vowed, “I will swear at you in that forum,” using the phrase Putang ina, a Tagalog epithet meaning "son of a bitch" or "son of a whore.”

Obama’s aides cancelled the meeting with Duterte but the Philippine president later climbed down from his belligerent posturing, expressing “regret” that his comments were seen as a direct attack against Obama. At least momentarily, Duterte too seemed chastened, and reluctant to alienate an ally that provides hundreds of millions of dollars annually to the Philippine military: “I do not want to quarrel with the most powerful country on the planet.” (Duterte—who’s been dubbed “Dirty Duterte” after Clint Eastwood’s famous “Dirty Harry” film character—has used the same derogatory term to describe the Pope, U.N. Secretary-General Ban Ki-Moon, and the “gay” American ambassador to Manila.)

***

No doubt Obama’s hosts heaved a sigh of relief to see Air Force One lift off Hangzhou without further diplomatic incident (when he departed, Obama went up the usual mobile staircase.) And on the whole Obama seemed far more relaxed than the Chinese about the brouhaha. As a lame-duck president, Obama will be vacating the Oval Office and handing over to a successor come January. Not so his Chinese counterpart Xi Jinping, who normally would step down in 2022, after two five-year terms in the top jobs. But many analysts believe Xi is maneuvering to set a new precedent by staying on for a third term—a move that could hit up against high-level opposition. Meanwhile his team is bracing for further uncertainties in the bilateral relationship.

Either way, it’s going to be somewhat ugly—and the effects of the “pivot” will continue. Trump has been bashing China during his entire campaign. While some ordinary Chinese are intrigued by his populism and the prospect of cutting deals with the GOP candidate, his nationalist haranguing has set off alarms in Chinese corridors of power. Had the airport “chaos” greeted him on arrival in Hangzhou, said Trump, unlike Obama he would have turned around, “closed the doors and gone back home.”

If Hillary Clinton is elected Obama’s successor, as most polls indicate will happen, the relationship may be more stable but no less fractious. The Chinese mandarins perceive Clinton as a diehard Beijing-basher, dating back to her criticism of Chinese human rights abuses during the Women’s Conference in the Chinese capital two decades ago. Chinese officials may not always have seen eye-to-eye with Obama, nor expected him to have much lasting power. But Xi and his team may yet find themselves longing for the “golden” days of Sino-U.S. relations after Obama’s gone.