HONG KONG — When the propaganda film, "The Founding of an Army," hit theaters in China recently, the reaction wasn't quite what the ruling Communist Party might have hoped.

Instead an outpouring of nationalism and self-sacrifice for the state, it inspired mockery for trying to lure a younger audience by casting teen idols as revolutionary party leaders.

Viewers more used to seeing the idols play love interests in light-hearted soap operas responded to the film by projecting "modern-day romantic narratives on the founding fathers of the nation," said Hung Huang, a well-known social commentator based in Beijing. "It was hilarious."

While China's resurgent Communist Party once pushed its policies on an unquestioning public, it now struggles to compete for attention with the country's booming entertainment industry and the celebrity culture it has spawned.

"Chinese people are increasingly ignoring party propaganda and are much more interested in movie stars, who represent a new lifestyle and more exciting aspirations," said Willy Lam, an expert on Chinese politics at the Chinese University of Hong Kong.

President Xi Jinping, who will cement his authority with his expected endorsement to a second five-year term at this week's national party congress, has placed a priority on stamping out too much Western influence in Chinese society in part so the party can dictate the values the youth should embrace.

Authorities have responded by targeting everything from gossip websites to soap opera story lines to celebrity salaries. Instead of selfish, rich stars, the state is promoting performers who are all about patriotism, purity and other values that support the party's legitimacy.

The results have at best been mixed and at worst ham-fisted and out of touch.

One problem is that the party's values often clash with what young Chinese want to watch, according to Hung. Among the more popular shows watched by Chinese youth are those that center on palace intrigue, martial arts fantasies, high school romances or single, independent women.

"While the government could once dictate to young people what they should value and how they should lead their lives, they find themselves completely without the tools to do that now," she said.

In the 1970s, the state was able to promote people seen as paragons of youthful devotion and selflessness, but Hung said that no longer works because young Chinese — like their counterparts in the West — now prefer to follow celebrity gossip and have the tools with which to do so.

Just this month, teen idol Lu Han, also known as China's Justin Bieber, announced he had a girlfriend, triggering so many shares, responses and "likes" within a few hours that the country's popular Weibo microblog service briefly crashed.

A recent commentary in The Global Times, a party newspaper with a nationalistic stance, railed against such celebrity worship, saying China had now surpassed the West in that regard.

"It's unfair that these stars accrue such glory, unimaginable to those who have made a decisive contribution to the country," the commentary said.

That was likely a reason the government-backed China Alliance of Radio, Film and Television moved last month to cap the pay of actors, whose salaries had hit historic highs as young Chinese and a burgeoning middle class increasingly spend on movie tickets and goods.

In another move earlier this year, authorities closed 60 popular celebrity gossip and social media accounts and called on internet giants such as Tencent and Baidu to "actively propagate core socialist values, and create an ever-healthier environment for the mainstream public opinion."

The tension between popular culture and state propaganda isn't new in China. In the 1980s, Deng Xiaoping's lieutenants railed against spiritual pollution. But it has gained new traction since Xi came to power in 2012 and officials began a wide-ranging crackdown on perceived societal ills from corruption to dissent to — now — entertainment.

"Xi Jinping has been advocating a revision to traditional, Confucian moral standards," Lam said. "The definition of what is vulgar or morally problematic has been inflated and expanded so that it has become all-encompassing."

Shows about the pursuit of great wealth and luxury that used to be tolerated under Xi's predecessor, aren't anymore.

The government has demanded that broadcasters "resist celebrity worship" and limit the air time dedicated to film and TV stars.

"The party does not want these entertainment programs to compete with news programs and 'morality shows,'" said Jian Xu, a Chinese media research fellow at Deakin University in Melbourne, Australia.

One example of a state-approved show is "Touching China," which honors people who have "touched the nation with their tenacity, bravery and wisdom."

The government has also tried to shape some celebrities into party-sanctioned role models.

Thanks to their wholesome image and uplifting, patriotic lyrics, the TFboys, China's first home-grown boy band, have risen to fame because of "political opportunities" they've been given, Xu said. The band is pursued by adoring fans and has performed twice on the coveted Lunar New Year gala hosted by state broadcaster China Central Television; it has also been promoted by the Communist Youth League.

Stars deviating from the party's image of purity and moral acceptability, however, have been punished. In a high-profile drug crackdown in 2014, authorities publicly chastised a succession of celebrities caught using drugs, including Jackie Chan's son, Jaycee Chan, and singer Li Daimo, forcing them to apologize on state television.

Beijing may struggle to win over young Chinese, but it won't stop its carrot-and-stick approach to regulating the industry.

"The government's method of punishment and praise is very obvious: If you work with me, you will reap the benefits, if you don't, you won't. If you're a good boy, you get candy, if you don't, you won't," Xu said.