China’s ruling Communist Party has seized on the high-profile detention of a Canadian Chinese pop singer in Beijing on suspicion of rape to deliver a stark warning against what it regards as a social ill: celebrity obsession.

In less than a month, the pop singer Kris Wu, 30, has gone from being one of China’s biggest stars, with several lucrative endorsements and legions of young female fans, to perhaps the most prominent figure in the country to be detained over #MeToo allegations. The police said over the weekend that Mr. Wu was being investigated after weeks of public accusations of sexual wrongdoing against him, though officials provided few details.

Born in China and raised partly in Canada, Mr. Wu rose to fame as a member of the Korean pop band EXO, before striking out on his own as a singer and actor. He built a huge following in China with his manicured good looks and edgy swagger. He amassed endorsement deals with many domestic and international brands, including Bulgari and Louis Vuitton.

Mr. Wu has not been formally charged, but his career in China has already taken a big hit. After mounting public pressure, more than a dozen brands cut ties with him. His Weibo social media account, where he had over 51 million followers, was taken down shortly after the news of his detention. His songs have also disappeared from Chinese music platforms.

Chinese women’s rights activists have hailed the detention as a rare victory for the country’s fledgling #MeToo movement. But the Communist Party’s official news outlets have largely cast the investigation into Mr. Wu as proof that the party, led by Xi Jinping, one of its most hard-line leaders in decades, defends the interests of ordinary people.

Guo Ting, a gender studies scholar at the University of Hong Kong, said, “Xi has tried to reinvent the party as the legitimate party for the people and the party of Chinese socialism for the people.” By going after Mr. Wu, she added, the party is “targeting the so-called rich and powerful, while evading the real kind of gray area of that wealth and power within the party elite.”

When the accusations against Mr. Wu first emerged weeks ago, the party’s propaganda outlets largely stayed quiet. But after his detention, they put out commentaries and news reports hailing it as a lesson to celebrities.

“Wu Yifan has money, he’s handsome and he has the status of being a ‘top star,’” read a commentary in The Global Times, a Communist Party-run newspaper, referring to the singer by his Chinese name. “Perhaps he thought that ‘sleeping with women’ was his advantage, maybe even his privilege.”

“But on this precise point he has made a mistake,” the newspaper noted.

Some of the rhetoric noted that foreign citizenship did not place celebrities beyond the reach of the law, pointing in part to continuing tensions between China and Canada as well as rising anti-Western sentiment among Chinese.

CCTV, China’s state broadcaster, said in a commentary, “No one has a talisman — the halo of celebrity cannot protect you, fans cannot protect you, a foreign passport cannot protect you.”

The state news media’s approach reflects the Chinese government’s recent crackdown on the entertainment industry and the culture of celebrity worship that Beijing has accused of leading the country’s youth astray. The authorities have stepped up censorship, cracked down on the widespread practice of tax evasion within the industry and ordered caps on salaries for the country’s biggest movie stars.

Concerns about the outsize influence of celebrities on the country’s youth reached a peak in May when fans supporting contestants in a boy band competition spent huge sums of money buying — then apparently dumping — yogurt drinks to vote for their favorite idols. The government promptly issued regulations aimed at cracking down on what they called “chaotic” online fan clubs and their “irrational” behaviors. The authorities on Monday said they had already taken down thousands of “problematic groups” as part of an ongoing effort to address “bad online fan culture.”

The authorities “are concerned about the impact on the youth,” said Bai Meijiadai, a lecturer at Liaoning University in northeastern China who studies fan culture. “They want to see the youth studying and working, not spending excessive amounts of money to chase stars.”

Mr. Wu, too, had an army of fans eager to open their wallets to bolster his image by buying albums and even making donations to charities in his name. He has also sought to use his influence to pressure his critics into silence, according to his accuser and a producer of a popular showbiz program.

The producer, Xiao Wei, said his show, “Xiu Cai Kan Entertainment,” had been compelled to remove a video it had posted online in which its hosts criticized Mr. Wu after the allegations of sexual misconduct had emerged. Mr. Xiao said the short-video platform Douyin had told the program that they had been contacted by Mr. Wu’s lawyers.

“This is an age of stars, fans and traffic,” Mr. Xiao said in an interview. “Money has become the only criterion to success — this is not right.”

China’s Tightening Grip

    • Xi’s Warning: A century after the Communist Party’s founding, China’s leader says foreign powers would “crack their heads and spill blood” if they tried to stop its rise.
    • Behind the Takeover of Hong Kong: One year ago, the city’s freedoms were curtailed with breathtaking speed. But the clampdown was years in the making, and many signals were missed.
    • One Year Later in Hong Kong: Neighbors are urged to report on one another. Children are taught to look for traitors. The Communist Party is remaking the city.
    • Mapping Out China’s Post-Covid Path: Xi Jinping, China’s leader, is seeking to balance confidence and caution as his country strides ahead while other places continue to grapple with the pandemic.
    • A Challenge to U.S. Global Leadership: As President Biden predicts a struggle between democracies and their opponents, Beijing is eager to champion the other side.
    • ‘Red Tourism’ Flourishes: New and improved attractions dedicated to the Communist Party’s history, or a sanitized version of it, are drawing crowds ahead of the party’s centennial.

The police investigation into Mr. Wu came weeks after a university student, Du Meizhu, now 18, accused the singer of enticing young women like herself with the promise of career opportunities, then pressuring them into having sex.

Ms. Du’s public accusations were met with an outpouring of support, but also criticism from the singer’s fans, prompting debates about victim shaming, consent and abuse of power in the workplace.

Some women’s rights activists saw Mr. Wu’s detention as a sign that feminist values had finally permeated the mainstream to the extent that the authorities could no longer afford to look the other way. They said they were hopeful that it would encourage more women to come forward to share their experiences and that it could lead to wider avenues for legal recourse for sexual assault survivors.

“This time, progress was made very suddenly, but it was very satisfying,” said Li Tingting, a gender equality activist in Beijing. “Everyone is looking forward to what will happen in the future.”

But it remained unclear if the police in Beijing were looking specifically into Ms. Du’s complaints. The authorities last month released initial findings about her allegations that said she had hyped her story to “enhance her online popularity.”

Ms. Du did not respond to requests for comment. Emails to Mr. Wu’s studio and his lawyer received no response. Mr. Wu denied the allegations on his personal Weibo account last month, saying he would send himself to jail if they were true.

Despite the surprise development, activists know that China’s #MeToo movement is tightly constrained by the government’s strict limits on dissent and activism. Women who have previously come forward with accusations of sexual harassment and assault against prominent men have often become targets of threats and defamation lawsuits. Feminist activist accounts and chat groups on Chinese social media sites are routinely shut down.

The swift manner in which the authorities have addressed the complaints against Mr. Wu contrasts with how they responded to #MeToo accusations against Zhu Jun, a prominent television personality at CCTV, the state broadcaster. Mr. Zhu was accused by a former intern, Zhou Xiaoxuan, in 2018, of forcibly kissing and groping her in 2014 while she was working on his program, accusations that he has denied. Ms. Zhou has sued Mr. Zhu for damages, but three years later, her complaint remains unresolved.

Mr. Wu, by comparison, is not part of the party establishment.

Professor Guo, of the University of Hong Kong, said, “It is still a state capitalist system and Wu Yifan is not a part of that official establishment,” adding, “His nationality and his status, I think, make it easy for the party to on one hand cut him off, while still maintaining its own legitimacy.”