The past few months have been challenging for China: A trade war with the United States has taken a toll on the economy, while months of protests in Hong Kong have raised questions about the sustainability of Chinese political control at the edges of its rule.

But rather than play down these challenges at home, President Xi Jinping’s response has been to accentuate the peril of foreign threats to the Chinese nation, while glorifying the bond between the Chinese Communist Party and the people. His bet has been that through cementing nationalism in China he will strengthen his hand. So far, this tactic has proved effective, but it is not without significant risks for China and for the world.

Whether the issue is Taiwan, the South China Sea or climate change, the primary audience for China’s actions on the world stage remains domestic. Even as China has become a superpower, the Chinese Communist Party remains more concerned with appearing to defend the nation with symbolic gestures and rhetoric than with actually fighting foreign powers. As Mr. Xi told the Central Committee in 2013, “Winning or losing public support is an issue that concerns the C.P.C.’s survival or extinction.”

China’s citizens were reared on grievances about their country’s subjugation at the hands of foreign powers. As tensions grow with the United States — especially as the Trump administration casts China as a “whole of society” threat, to use the words of the F.B.I. director, Christopher Wray — this sense of victimization will continue to drive China’s foreign policy.

From the time Mao Zedong seized power 70 years ago until today, Chinese leaders have staked their claim to rule on safeguarding the nation against foreign adversaries after a history of invasion and occupation. With the founding of the People’s Republic of China in 1949, Mao declared: “Ours will no longer be a nation subject to insult and humiliation. We have stood up.” After the political crisis in 1989 and the widespread disillusionment that followed the brutal crackdown at Tiananmen Square, the Chinese Communist Party began a nationwide patriotic education campaign to encourage pride in China’s achievements and in the party for helping the country overcome a “century of national humiliation.”

Such propaganda has been surprisingly effective at creating room for the government to maneuver amid international challenges. For example, in 2013, as tensions escalated with Japan, instead of using force, Beijing employed fiery words and demanded that foreign aircraft identify themselves and comply with Chinese instructions when flying over the East China Sea. In 2001, after a midair collision with an American spy plane, China defused the crisis by mourning the “martyred” pilot while avoiding a repeat of the anti-American demonstrations that had swept the country in 1999. In my research, I have found that the government has helped shore up public approval by reminding citizens of the nation’s long struggle and emphasizing that China will ultimately prevail by biding its time for future success.

Yet this strategy has costs. Chinese leaders risk tying their hands in the long run if invoking historical grievances hardens the public’s desire for vindication in the future. Opinion polls show that the public is hawkish on territorial disputes and American military operations in Asia, making it hard for Beijing to reassure the region that its intentions are peaceful. And each time the government spins up and then winds down nationalist anger, whether online or in the streets, it breeds resentment against its heavy-handed manipulation. Blanketing the airwaves and the internet with propaganda may foster the appearance of conformity, but it also hides public disenchantment.

And under Mr. Xi, nationalism has taken on a particularly virulent form. The government has detained more than a million of its Muslim minorities in Xinjiang Province and sought to “Sinicize religion” by replacing expressions of ethnic and religious identity with patriotic slogans. Meanwhile, the Chinese Communist Party’s attempts to inculcate loyalty and squelch opposition among the diaspora in Taiwan and Hong Kong have aroused concerns that Beijing cares more about its vision of ethnic unity than respect for sovereignty and the rule of law. These efforts may bolster the hand of those in the United States promoting a new “red scare” that targets ethnic Chinese and policies that restrict scientific research on the basis of national origin.

For all of Mr. Xi’s rhetoric about “a China solution to humani­ty’s search for better social systems,” the Chinese Communist Party has not tried to export its ideology or system of government, unlike Soviet efforts to spread communism or American programs to promote democracy. In seeking to make the world safer for the party, Beijing has made it easier for authoritarian states to coexist alongside democracies. Mr. Xi’s overriding focus is not on spreading his brand of autocracy, but on eliminating risks to his rule at home and securing his nation’s economic growth and security.

But China is not a monolith. Many Chinese resent the direction Mr. Xi has taken the country’s politics and foreign policy. By narrowing the range of what is acceptable, by forcibly linking nationalism with unquestioning loyalty to the Chinese Communist Party, and by reining in the limited freedoms that many in China had come to enjoy, the party has alienated many citizens who had previously accepted a somewhat more responsive and respectful form of authoritarian rule. In the last few years, the party under Mr. Xi has created an image of strength that masks an increasingly brittle — as well as brutal — form of rule. The bill for Mr. Xi’s approach may yet come due, with threats to his rule more likely to come from within than from without.

Jessica Chen Weiss (@jessicacweiss) is a professor of government at Cornell and the author of “Powerful Patriots: Nationalist Protest in China’s Foreign Relations.”

The Times is committed to publishing a diversity of letters to the editor. We’d like to hear what you think about this or any of our articles. Here are some tips. And here’s our email: letters@nytimes.com.

Follow The New York Times Opinion section on Facebook, Twitter (@NYTopinion) and Instagram.

(adsbygoogle = window.adsbygoogle || []).push({});
(adsbygoogle = window.adsbygoogle || []).push({});