The Communist Party is reviving traditional beliefs for political gain — while cracking down on some faiths.

Credit...Sim Chi Yin/Magnum Photos

BEIJING — In the northern suburbs of this city is a small temple to a Chinese folk deity, Lord Guan, a famous warrior deified more than a millennium ago. Renovated five years ago at the government’s expense, the temple is used by a group of retirees who run pilgrimages to a holy mountain, schoolchildren who come to learn traditional culture and a Taoist priest who preaches to wealthy urbanites about the traditional values of ancient China.

Perched atop a hillock overlooking the sprawling capital, the temple is a microcosm of a new civil religion taking shape in China — an effort by the Chinese Communist Party to satisfy Chinese people’s search for moral guidelines by supplementing the largely irrelevant ideology of communism with a curated version of the past.

This new state-guided religiosity is the flip side of the government’s harsh policies toward Islam and Christianity. Officials believe these two global faiths are hard to control because of their foreign ties, and they have used negotiation or force — diplomacy with the Vatican, arrests of prominent Protestants, internment camps for Muslims — to try to bring these religions to heel.

Yet Beijing’s recent turn to tradition may be even more significant. Even though Islam and Christianity are world religions, in China they remain minor, with the number of their combined adherents amounting to less than 10 percent of the population. Most Chinese believe in an amalgam of Buddhism, Taoism, Confucianism and other traditional values and ideas that still resonate deeply.

For this silent majority of hundreds of millions of people, the government’s newfound support for things like the temple to Lord Guan is welcome — a feeling that the Chinese Communist Party hopes will bolster its legitimacy, especially given the irrelevance today of its founding ideas. The benefits of its move to embrace the past may seem obvious, but the shift marks a radical departure, not just for a party officially committed to atheism but also from how reformers over the past century have imagined a modern, prosperous China.

From the 19th century onward, China’s elites argued that the country’s traditions and faiths were a major reason for its decline. Reformers in 1898 called for temples to be converted into schools. While the Nationalist Party under Chiang Kai-shek approved of four religions — Buddhism, Taoism (sometimes called “Daoism”), Christianity and Islam — it largely considered traditional Chinese beliefs to be superstitions and advocated the destruction of temples.

Scholars estimate that by the middle of the 20th century, half of the temples that existed in China at the end of the 19th century had been destroyed. An 1851 survey of the old city of Beijing listed 866 temples; today, I count just 18. At the end of the 19th century, most villages had at least one temple and many had half a dozen; vast sections of the Chinese countryside now have no temples at all.

When the Communists took power in 1949, they, like the Nationalists, officially recognized four religions — but then promptly began persecuting them. Traditional faiths came under especially harsh treatment, with the government banning bedrock traditional practices, from worshiping ancestors and local deities to following the advice of geomancy masters and spirit mediums.

The three decades of reform that started in the late 1970s loosened controls over society, allowing the revival of all religions and many traditions that had been proscribed. Despite periodic crackdowns, churches and mosques, but also temples, were rebuilt, and clergy trained. Although all faiths were supposed to remain under party control, religious feeling boomed, with the number of believers in China topping 500 million by 2010.

Xi Jinping’s rise to power in late 2012 marks a new era, the third, in the history of the Chinese Communist Party’s religious policies. Instead of the destruction of the Mao years and the relatively laissez-faire approach of the reform period, the state has embarked on a form of highly curated revivalism.

One part of its approach rests on a deep suspicion of Christianity and Islam. The party’s policy toward Islam has been the most draconian. Some believers, especially Uighurs in the northwestern province of Xinjiang, have been subjected to a policy of forced secularization. This has included sending hundreds of thousands of Muslims to re-education camps, compelling restaurants to serve pork and alcohol, and forbidding fasting during Ramadan.

The policy toward Christianity is more nuanced. Last year, Beijing struck a deal with the Vatican to jointly appoint Catholic bishops. The Vatican seemed to hope to reverse the decline in the number of Catholics in China. But for Beijing, the measure was a way to tighten control over the Catholic clergy — and, by extension, the church itself.

Protestantism poses an especially vexing problem for the party. It is arguably China’s fastest-growing religion, with an estimated 60 million or more adherents today (compared with one million in 1949), including some 20 to 30 million who are thought to worship in unregistered (or underground) Protestant churches. But the faith lacks a unifying structure that would allow for negotiations. And so the government has fired a few shots across the bow, closing several of the country’s best-known underground churches.

In many ways, however, the Xi administration’s embrace of traditional faiths is more radical. Since taking office, the president has met with Buddhist leaders, and his government has allowed Taoism to flourish. The state recently issued a landmark plan to improve social mores, the first such program since 2001.

The plan stems from a widespread feeling that China’s relentless drive to get ahead economically has created a spiritual vacuum, and sometimes justifies breaking rules and trampling civility. Many people do not trust one another. The government’s blueprint for handling this moral crisis calls for endorsing certain traditional beliefs.

The epic paper — it runs to 10,000 Chinese characters, and would be significantly longer translated into English — doesn’t mention Communist China’s founding father, Mao Zedong, or his successors and their ideologies, focusing instead on Mr. Xi and his efforts to fix social problems like “money worship and hedonism.” It does invoke Communist slogans such as “core socialist values,” but in contrast to the previous such document from 2001 — which made only passing reference to Chinese traditions — it calls the past a “rich source of morality.” The plan orders party officials to promote “ancient and worthy sages,” as well as to “deeply expound” traditional concepts such as “ren’ai” (benevolence), “zhengyi” (righteousness) and “jianyi zhengwei” (standing up bravely for the truth).

This effort is not an attempt to replace Communism with Confucianism. Yet it is fair to say that for the first time since China’s imperial order collapsed in 1911, a central government is embracing the ideas that made up the political-religious order that ran China for much of the past 2,500 years. Why? Not only to address China’s moral vacuum, but also as a populist measure. The country is entering a more uncertain era, of slower growth and rising inequality, and Beijing is draping itself in the mantle of tradition to broaden its appeal.

In doing so, the government seems to be assuming that traditional Chinese values and beliefs are easier to control than foreign religions, and that supporting them will outweigh the costs of suppressing Islam and Christianity. But I have my doubts.

During a visit this fall to the Lord Guan temple, I saw a dozen or so people, mostly in their 30s and 40s, reading works by Wang Yangming, a philosopher born in the late 15th century. On the face of it, this was in line with government policy: The party has embraced Wang for exemplifying an incorruptible spirit and matching words with deeds.

But after reading a passage of Wang’s work, the men and women sat around a big wooden table, wielding brushes to write out, over and over again, his most famous phrase: “zhi xing he yi (knowledge and action are one). This knowledge, according to Wang, comes from an inner light, a conscience — one that no government, no matter how powerful, can control.

Ian Johnson (@iandenisjohnson) is the author most recently of “The Souls of China: The Return of Religion After Mao.”