BEIJING - Mr Liu Yijun, 26, grew up in a family that was not particularly religious although his parents might go to the temple occasionally and he would go along without understanding what it was about.
It was only after leaving home in Meizhou city, Guangdong province, in his teens that he came into closer contact with religion and began to get religious.
He first encountered Christianity at a missionary school in Hong Kong where he went to study and then Buddhism at university in Guangzhou and Beijing.
As a young student living far from home "I had a lot of worries", he said, whether it was over relationships with the people around him or with his parents.
He also got to thinking about the meaning of life and questions about life and death.
That was how he turned to religion. He rejected Christianity because it "has a lot of constraints" and he did not agree that there was just one God, believing instead that everyone could become like God.
Now a graduate student of traditional Chinese medicine in Beijing, Mr Liu practises Buddhism, chanting Buddhist scriptures daily. But he does not go to the temple.
"People go to the temple to ask for things like promotion or wealth, not to understand Buddhism, it's all utilitarian," he explained.
Instead he practises his religion in different aspects of his life such as by treating other beings with benevolence and fulfilling his obligations in work and study, he said.
Unlike Mr Liu, Mr Ma Fuyun, 34, grew up in a strict Muslim family in a Hui minority community in Qinghai province.
But it was only after leaving home to study in Beijing that he understood his religion more and became more steadfast as a Muslim.
"Before I left home, I was believing blindly in Islam," he said.
Away from home, he came into contact with other religions which he at first felt repelled by but which he slowly came to accept as different ways of searching for the origins of life.
Most importantly, in his darkest moments of depression when he contemplated suicide, his faith prevented him from doing so, as suicide is not allowed in Islam.
This and his encounters and experiences in the city have made "me very staunch in my faith now", said the post-doctoral student of traditional Chinese medicine.
The spiritual journey of Mr Liu and Mr Ma has been that of many in China since after the Cultural Revolution, the period in Chinese history from 1966 to 1976 during which religion was attacked and suppressed as part of a campaign to destroy old customs, culture, habits and ideas. Temples, churches and mosques were destroyed and clergy tortured, sent to re-education camps and even killed.
As China embarked on reforms and opening up to the outside world from 1978, the atheist Chinese Communist Party (CCP) also changed its approach towards religion from that of eradication to regulation.
It sought to "manage religion, harness its influence to achieve other party goals and suppress any threat it may present to the party's authority", according to a 2017 report on religious revival, repression and resistance in China today by Freedom House, an American non-governmental organisation.
"In the background was the Marxist assumption that with further economic development, 'feudal'religious beliefs would inevitably fade," it added.
After decades of varying degrees of suppression since the CCP came to power in 1949, religion and spirituality, long part of China's society, began to make a comeback from the 1980s.
The reasons are myriad.
There was the crisis of faith in the Communist ideology in the post-Mao Zedong era, noted Professor of World Christianity Lian Xi of Duke University in the United States.
"The Cultural Revolution (unleashed by Mao) and its excesses had undermined the Communist faith," he explained. He added that the Tiananmen incident of June 4 1989 - in which hundreds or even thousands of pro-democracy demonstrators were killed - put a final nail on the coffin of Communism, destroying it as a faith for the people.
Religion filled the spiritual vacuum that emerged.
Also, as China emerged from its isolation and Chinese began to travel abroad, they saw that religion was not backward and that advanced countries were not secular, as they had been told. Instead, they saw that Christianity was strong in the US, Islam vibrant and Buddhism popular in advanced countries like Japan and Singapore, said Professor Dru Gladney of Pomona College in the US.
This led to a fascination with religion among the Chinese, he added.
As China loosened its "hukou" or residential permit system to allow internal migration to facilitate economic development, religion also found room to grow.
Islam spread from the western provinces, where ethnic minorities that were Muslim were concentrated, to the coastal provinces in the east - which hitherto had small Muslim communities - as Muslim traders and workers moved east to take advantage of the growing economic activity there.
In the trading city of Yiwu in coastal Zhejiang province, for example, the number of Muslims grew from just 400 in 1982 to about 35,000 in 2012.
The mass migration of Chinese workers has led to the dislocation of many from their families and traditional communities, and religion offers them the connectedness and community that they might have lacked otherwise.
For Madam Li Feng (not her real name), 63, who came to Beijing from central Henan province two years ago to look after her grandson, being a member of a small church gave her just that. In church, she belongs to a cell group of women around her age, many of whom, like herself, have come from their hometowns in provinces as far flung as Sichuan, Heilongjiang and Henan to take care of grandchildren or to work.
"We encourage each other and comfort each other," she said.
Mr Paul Zhang (not his real name), 36, started going to Christian meetings in the hope of finding a girlfriend but has gone on to serve in more than one church.
Apart from emotional support, religious communities also offer a social safety net.
As China's economy developed and liberalised in the 1990s and 2000s, its old "cradle to grave" social security system that supported workers through ill health, economic hardship and old age has broken down. While the state has sought to create a new social security system, it is not yet adequate.
"For people who are insecure about their future, being part of a religious community, whether it is Christian, Muslim or Buddhist, offers a certain kind of support system that traditionally the state offered in the past, but which, with China's rapid development, the state has not kept pace with," said Prof Gladney.
While all major religions have seen an uptick in numbers of followers, Christianity is regarded to be the fastest growing. Christianity with its organisational strength, ethics and adaptability found itself in a strong position to compete in the market of faiths, said Prof Lian.
There are some estimations that the number of Christians has grown by an average of 10 per cent a year since 1980.
According to Freedom House, there are some 250 million Chinese Buddhists, 8 million Tibetan Buddhists, 80 million Protestants, 12 million Catholics, 23 million Muslims and 20 million Falungong followers.
However, as the numbers grew, control over religious practices has been tightened in recent years.
Said the Freedom House report: "Since Xi Jinping took the helm of the Chinese Communist Party in November 2012, the authorities have intensified many of their restrictions, resulting in an overall increase in religious persecution."
These include new and largely restrictive legal instruments; expanding targets of repression to include previously tolerated activities and individuals such as praying in a field or people who help persecuted religious believers; increased state intrusion in daily life such as banning of some popular festivals and constraining of children's religious education and participation; and use of electronic surveillance at places of worship.
"The recent hardening of the religious policy reflects the state's increased fear that religion can undermine the state's control, prestige, and its claim to truth," said Prof Lian.
The hardest-hit religions, he added, are Tibetan Buddhism, Islam in Xinjiang region, and Christianity in general.
In particular, as many as one million Muslims - mostly from the Uighur minority group - in Xinjiang have been sent forcibly to re-education camps in a bid to "de-extremify" them, a move that has been condemned by the United Nations.
The Chinese government has defended the camps saying they are vocational training centres that are meant to deal with Islamic extremism.
In cracking down on religion, however, the government is depriving itself of societal resources to cope with an array of problems and needs faced by the people, from earthquake relief to care for the poor or jobless or the disabled or mentally ill, said Prof Lian.
This is because religious communities have provided many services and met both the material and emotional needs of the people beyond what the state is capable of doing, he added.
Religious control exacerbates popular distrust and resent against the government and "will inevitably sow the seeds of radical or eschatological religion which will turn believers against the government", he warned.
Ms Aileen Li (not her real name), 40, a Christian, said while the government's harsh actions may yield results in the short term, in the long term it is impossible for it to control religion.
"This is because doing so runs counter to the needs of the people."