U.S. President Donald Trump has repeatedly attacked China on everything from trade to Taiwan to pressure his counterpart Xi Jinping to cede ground. In doing so he risks a backlash that could make doing deals even harder.
China has a population of 1.3 billion and its dominant state-run media seeks to burnish the image of the Communist Party. In that environment, Trump's hectoring could stoke nationalism in a year where China's leaders are already working hard to instill public pride and stress unity.
If Trump's rhetorical blasts fan Chinese patriotism, it could give Xi less room to negotiate without appearing weak at home, raising the odds he retaliates. That's even as China's leaders generally are careful to try and prevent nationalism taking on a life of its own, in case it sets off broader social unrest.
Like prior presidents, Xi uses nationalism to bolster his standing as well as the party's. Sounding powerful on the global stage, and deflecting provocations from other nations, is one way to foster that. Since coming to power Xi has expanded the reach of China's military and stepped up assertions to territory in the South China Sea.
"If the Chinese people perceive Xi Jinping to be bullied by Trump, they will expect a very strong response," said Paul Haenle, a China adviser to former President George W. Bush and now director of the Carnegie-Tsinghua Center for Global Policy in Beijing. "If it gets really bad, you could see nationalism kick in" like the anti-Japan protests of late 2012.
At the height of those frictions with Japan over the East China Sea, which occurred shortly before Xi's elevation, Chinese took to the streets in more than a dozen cities, smashing Japanese cars, tearing up Japanese flags and looting Japanese shops.
The rampage was set off when the Japanese government nationalized three disputed islands, sparking claims Tokyo infringed on China's sovereignty and "hurt the feelings of the Chinese people."
At one point demonstrators turned their criticism onto the central government, displaying posters of the party's late chairman, Mao Zedong, to imply he'd take a stronger stance than the authorities in Beijing. Others used the protests to show their support for disgraced politician Bo Xilai, known for his efforts to revive Maoist policies.
Now, Trump and his team risk offending China's nationalists by railing against Beijing on Taiwan and the South China Sea -- areas that party leaders consider "core interests" that can't be negotiated.
As Xi prepares for a twice-a-decade party leadership reshuffle later this year, any provocations carry added risk because he needs to project an image as a strong leader who won't be cowed by U.S. policy that appears to be aimed at containing China.
Trump's suggestion he might use the threat of officially recognizing Taiwan, which China regards as a province, to get a better trade deal could result in Xi making no concessions on trade at all. Trump has also complained China hasn't done enough to help disarm North Korea, and his pick for Secretary of State Rex Tillerson proposed blocking China's access to reclaimed reefs in the disputed South China Sea.
At the same time, Xi needs to avoid letting nationalism get out of hand.
"Any nationalist protests would also probably put the government under fire," said Zhu Feng, executive director of the China Center for Collaborative Studies of the South China Sea at Nanjing University. "It's a double-edged sword. Nationalist sentiments could backfire vis-a-vis the government."
Chinese authorities are perpetually worried that "bad elements" will take advantage of nationalist protests to cause trouble, said Jessica Chen Weiss, author of "Powerful Patriots: Nationalist Protest in China's Foreign Relations" and an associate professor at Cornell University in New York state.
"One lesson of the 2012 anti-Japanese demonstrations is that mass protests may invite anti-government criticism on unrelated issues without necessarily convincing foreigners that the government faces nationalist pressure to take action," she said.
Chinese nationalism took wing as the nation emerged as the world's second-largest economy over the past three decades. Xi has fanned its emergence, bolstering talk of overcoming a "century of humiliation" at the hands of foreign powers that carved up China's territory in the 19th century and regaining its position as a global power.
Xi continues a campaign to instill a sense of grievance into China's national psyche. The Ministry of Education this month ordered textbooks at all levels to extend by six years the "Chinese War Against Japanese Aggression," emphasizing that hostilities stretched back to 1931, rather than 1937 previously.
So far China has taken a measured response to Trump. Statements and editorials have strongly reiterated China's stance on issues such as Taiwan and the South China Sea, but avoided inciting public outcry.
When Tillerson proposed China be denied access to parts of the South China Sea, the party-run Global Times, known for its ultra-nationalist positions, suggested he may have been "coaxing" the foreign relations committee conducting his confirmation hearing.
Foreign Minister Wang Yi said on Tuesday he wants to manage disputes. "We are willing, on the basis of strictly abiding by the One-China principle and respect of each other's core interests, to have dialogue with the new U.S. government," he said in comments on the ministry website.
There would only be a nationalist backlash against the U.S. with Chinese government encouragement, said Anne-Marie Brady, who studies the party as a political science professor at the University of Canterbury in New Zealand.
Still, if Trump accelerates his rhetoric, especially on "core" issues, Xi may have little option but to respond.
"It's very costly for the Chinese leadership to keep grassroots nationalism in check," said Chen Weiss. "If the Trump administration follows through with its casual rhetoric about abandoning the One-China policy, Xi Jinping may unleash popular nationalism to show resolve over Taiwan and rally the public."