ZHENGDING (China) • In 1982, two men arrived in this dusty provincial town. One was Shi Youming, a Buddhist monk who was taking up a post in the ruins of one of Zhengding's legendary temples. The other was Mr Xi Jinping, the 29-year-old son of a top Communist Party official putting in a mandatory stint in the provinces as a bureaucrat in the government he would eventually lead.
The two forged an unusual alliance that resonates today. With Mr Xi's backing, Shi Youming, who like most Buddhist monks preferred to go by one name, rebuilt the city's Linji Temple, the birthplace of one of the best-known schools of Buddhism. Even after Mr Xi was transferred, he regularly visited Shi Youming in Zhengding and sent officials there to study the partnership between the party and religion.
Mr Xi's early encounters with religious life give insight into a man who has run China with a firmer hand than any other leader since Mao Zedong. Although he is best known abroad for his efforts to expand China's territorial reach in the South China Sea or his high-profile campaign against corruption, at home, the President is engineering a remarkable about-face for the Communist Party: an effort to rejuvenate China's spiritual life through an embrace of some religions.
As an organisation that has tried to squelch religion, the Communist Party under Mr Xi is now backing it in ways that echo the approach of strongmen like Mr Vladimir Putin of Russia, who use faith to legitimise their rule. Many Chinese people want to believe their leaders have some sort of spiritual beliefs.
Mr Xi, by making China a guardian of a major faith like Buddhism, also sees religion as a way to promote China's position in a world still dominated by the United States, which he tentatively plans to visit for a meeting with President Donald Trump early this month.
Indeed, one of Mr Xi's signature lines is "If the people have faith, the nation has hope, and the country has strength".
China's communists were not always antagonistic towards religion. Before winning the civil war in 1949, the party found refuge in China's north-west. Its numbers reduced by disease and attacks, the Communist Party needed local allies, such as Tibetan Buddhists and Hui Muslims, and pious Chinese farmers. So the party took a pragmatic approach, basically leaving religion alone as long as it didn't challenge party rule.
PRAGMATIC APPROACH TO RELIGION
This changed in the late 1950s, when Mao entered the final 20-year megalomaniacal phase of his life. He presided over the destruction of tens of thousands of temples, churches and mosques. But others in the party were much more cautious - and eventually they took power.
Mr Xi's father, Mr Xi Zhongxun, was a key member of this pragmatic faction. Beginning in 1980, Mr Xi Zhongxun headed the party's religious work. Two years later, still on his watch, the Central Committee issued what to date is its most important paper on religious policy, Document 19. This 11,000-word report warned party members against banning religious activity, saying that doing so would alienate too many people. It also called for temples, mosques and churches to be restored, and religious professionals to be "rehabilitated".
That same year, his son Jinping arrived in Zhengding. The younger Xi's attitude towards Shi Youming and the temples in the old city could have been motivated by many factors. Zhengding was isolated and poor, but its cultural wealth could be parlayed into tourism. Mr Xi used his family ties to lure to Zhengding the filming of a big historical drama - he probably saw religion as part of an economic development strategy.
And like his father, Mr Xi might have also seen religion as a tool to develop and rule a part of the country with strong religious roots.
But during several visits to Zhengding over the past five years, I discovered a more complex picture of China's leader. Mr Xi was a pragmatist, but evidence also points to his being motivated by genuine respect for traditional Chinese faiths, such as Buddhism, Taoism and folk religion.
He became a regular visitor to Linji Temple, helping to dismantle bureaucratic hurdles while Shi Youming raised money for the temple's reconstruction. In 1983, according to local records, Mr Xi approved the reopening of the temple to the public, even though it was still in ruins, and he eventually installed Shi Youming as its abbot.
Today, Zhengding is a suburb of Shijiazhuang, the sprawling capital of Hebei province. The Linji Temple has changed significantly. The pagoda is now part of a much bigger complex of rebuilt halls, a library and monks' quarters. Shi Youming died in 2010, and his living area has been turned into a little shrine, decorated with calligraphy, an altar and display cases along the walls.
During one of my visits, I met the current abbot, Shi Huichang. He had come to the temple in 1989, well after Mr Xi had been transferred to a bigger post on China's coast, but he was present for Mr Xi's later visits.
"Xi did a great service for Buddhism," Shi Huichang told me as we viewed the display cases filled with Shi Youming's clothes, books and photos. "He showed respect. I'm not sure he was a believer but he respected it. He knew more about it than most people."
We stopped at a vitrine holding a picture of the two from the 1980s. They were an odd couple: Mr Xi, tall for a man of his generation at 1.8m, with the thick black swept-back hair of a South Korean movie star. Next to him, Shi Youming was a wisp in a saffron robe, his head shaven, laughing like the Zen master he was - what could be more absurd than my present situation, he seemed to be saying, walking with a representative of the party that tried to wipe out my faith?
Zhengding was not a one-off in Mr Xi's political biography. During a 2005 visit to Zhengding and the Linji Temple, Mr Xi ordered senior Buddhist leaders to study how the temple had been rebuilt - a clear sign that his stint in Zhengding was meant to be an example of how government and religion should work together. He also called on Buddhists to unite to promote China's biggest religion - a seemingly strange request from a Communist Party official.
Does any of this prove Mr Xi's own religiosity? As Communist Party members, China's leaders are required to be atheist. And yet Chinese who knew Mr Xi well believe he at least looked favourably on Buddhism and other traditional religions.
A childhood friend of his who was also his neighbour in the 1980s supported this view in conversations with a US diplomat. According to a record of this transcript released through WikiLeaks, Mr Xi's friend - referred to in the diplomatic cable as "the professor" - said he visited Mr Xi in Fujian, shortly after having left Zhengding. Mr Xi, according to the professor, "displayed a fascination with Buddhist martial arts, qigong and other mystical powers said to aid health, as well as with Buddhist sacred sites". The professor said that he did not know whether Mr Xi was truly religious but that he "was extremely surprised by how much Xi knew about the subject and Xi's seeming belief in supernatural forces".
If Mr Xi was favourably disposed towards Buddhism, he seems to have had more trouble with Christianity. From 2002 to 2007, he served as party leader of Zhejiang province, where his administration received a black eye when it confronted local Christians. A congregation in the township of Xiaoshan had built a church, but the government declared it illegal and tried to demolish it in 2006. Hundreds of believers flooded the area, pushing back police.
Although the government eventually succeeded in tearing down the church, it became one of the most embarrassing episodes in Mr Xi's period in Zhejiang.
Not surprisingly, Christians have fared poorly during the past five years of Mr Xi's rule. Most notoriously, over 1,500 crosses have been pulled off the steeples of churches in that same province. Probably not coincidentally, the head of Zhejiang who has overseen this operation was Mr Xi's top law enforcement officer during the 2006 episode. Mr Xi almost certainly would have had to have signed off on the cross-removal campaign, re-emphasising the fact that he is probably better disposed towards religions considered more traditional in China - Buddhism, Taoism, Confucianism and folk religion - than those deemed foreign, like Christianity and Islam.
This is reinforced by Mr Xi's activities since taking office. In 2013, he lauded Confucius on a visit to his birthplace, Qufu, in Shandong province. The next year, he spoke favourably about Buddhism while visiting Paris.
Over the past five years, religion has also become a tool for improving Communist Party officials' ethics, with officials in some localities instructed to read the classics to elevate their morals.
What does this mean for China's future? Economically, it's fair to say that the easy phase of economic reform has passed. If Beijing wants to continue economic reform, it will require asking the population for yet more wrenching changes. But if it doesn't reform, growth will stagnate. Either way, the government faces potential social unrest.
I've found that Mr Xi's embrace of faith is incredibly popular among most Chinese. While Christians may cringe at his views, many others see his support for traditional faiths as positive - a re-creation of the imperial Chinese state's support for certain faiths and belief systems.
Far from being an anomaly in Mr Xi's rise, his stint in Zhengding is most likely something else: a template for the mixing of faith and politics - a re-imagining of the political-religious state that once ruled China.
• Ian Johnson, a reporter in Beijing for The New York Times, is the author of The Souls Of China: The Return Of Religion After Mao, from which this essay is adapted.