The communists who took the reins in China in 1949 viewed religion as backward and superstitious. Authorities did their best to wipe out religious life. And by the end of the 1970s, they'd been very successful.

"There were basically no functioning places of worship in the entire country. This is a place that had over 1 million temples and scores of churches and thousands of mosques," says Ian Johnson, the author of the new book "The Souls of China: The Return of Religion After Mao." "They were all closed down or destroyed."

But these days, Johnson says, religion has not only survived in modern China, it's thriving.

"(Karl) Marx said that religion was the opiate of the masses, and sometimes I think that the (Chinese) government is a little cynical and thinks, 'Yeah maybe it is the opiate of the masses, but for us, now, we'll use it as the opiate to keep the people in line.'"

President Xi Jinping has called on China's citizens to continue to be "unyielding Marxist atheists." He insists that the country's 85 million Communist Party members remain atheists. But increasingly, he's loosening the restrictions on religious organizations. These days, Chinese authorities even subsidize some religious practice under the guise of backing what the government calls "traditional culture."

Johnson writes about the myriad ways religions are practiced today in China. He describes walking in an elaborate Buddhist-inspired funeral procession in the Beijing neighborhood called the Temple of the Tolling Bell. He delves into the small sect, Eastern Lightning, a cult-like group that will remind some readers of Falun Gong, a Chinese spiritual practice. Eastern Lightning dared to attack China's Communist Party.

"They feel it's them against what they call the 'Great Red Dragon,' which is the Communist Party," Johnson says. "They operate illegally, and they almost try to hijack church congregations. They sometimes resort to violence; and their very secretive nature, their proclivity for violence, in some ways, this also reflects how the Communist Party runs China," Johnson says.

The "red line" for the faithful is foreign involvement.

"If people are part of a religion that has a strong foreign component, if they're getting money from abroad, if they're getting training, this is a problem for the government," Johnson says.

But ultimately, all religions are global. And that may increasingly pose a problem for Chinese authorities.

"It's a double-edged sword for the government," Johnson says. "They think religion can maybe provide some stability in a society that is racing forward and doesn't have a center of gravity. ... But religion creates values that are above any government values, ideas of justice, of righteousness, of truth and these things can come back to haunt the party."

This article originally appeared on PRI.org. Its contents were created separately to USA TODAY.