The actor son of Hong Kong action superstar Jackie Chan has been detained in Beijing on drug-related charges, the latest high-profile celebrity to be ensnared in one of China's biggest anti-drug crackdowns in two decades.

Jaycee Chan, 31, was detained together with the 23-year-old Taiwanese movie star Kai Ko, Beijing police confirmed on their official microblog, identifying them only by their surnames, ages and nationalities. It was unclear why the detentions were announced several days later.

Police said both actors tested positive for marijuana and admitted using the drug, and that 100 grams of it were taken from Jaycee's home.

Jaycee Chan's management, M'Stones International, apologised to the public on his behalf for the "social impact" caused in a statement on their website. It said they would "supervise his rehabilitation and help him return to the right path."

The detentions follow a declaration in June by President Xi Jinping that illegal drugs should be wiped out and that offenders would be severely punished. In Beijing alone, more than 7,800 people have been caught in the crackdown, police said.

A string of celebrities have been among those detained, including Gao Hu, who acted in Zhang Yimou's 2011 movie The Flowers Of War.

Last week, 42 Beijing performing arts associations and theatre companies signed a pledge to not hire any actors connected with drugs in an event organised by the capital's Narcotics Control Office and the Beijing Cultural Bureau.

Pi Yijun, an anti-drug adviser for the Beijing government, said authorities were targeting celebrities because "these people have a large number of fans, so their behaviour tends to have a huge influence on young people."

Chinese state broadcaster CCTV aired footage of a police search of Jaycee's home in Beijing in which he is depicted, his face pixelated, showing officers where he stashed bags of marijuana. Police said they acted on a tip-off from the public.

Jaycee is accused of accommodating drug users, an offence that carries a maximum sentence of three years' imprisonment - a far more serious charge than that of drug consumption. Two other people detained in the same case were accused of selling drugs while Ko is accused of drug consumption.

China named Jackie Chan an anti-drug ambassador in 2009. Ko, the Taiwanese star, was part of an anti-drug campaign two years ago, CCTV reported, showing footage of the campaign in which he joins other celebrities in a chorus declaring: "I don't use drugs."

Ko was shown on CCTV, his face pixelated, tearfully apologising to his fans and family.

"I feel very regretful, very sorry to all the people who support me... I've been a very bad example, I've made a very big mistake," Ko said. In a statement online, his management company, Star Ritz Productions, said Ko had received a 14-day detention and also apologised to the public.

Ko, whose real name is Ko Chen-tung, became a sensation after his 2011 film You Are the Apple of My Eye, a box-office hit in Taiwan. He won Best New Performer award for his role in the coming-of-age movie at the Golden Horse awards in Taiwan, considered the most prestigious in Chinese-language cinema.

He played the boyfriend of one of the protagonists in China-produced Tiny Times 3.0, which appealed to young female audiences and knocked Transformers 4 off the number one spot as the most watched film after its release in the mainland last month.

Illegal drug use has ballooned in China in recent decades, after being virtually eradicated following the 1949 communist revolution. Narcotics began to reappear with the loosening of social controls in the late 1980s.

In more recent years, rising wealth and greater personal freedoms have been accompanied by a growing popularity of methamphetamines and the party drugs Ecstasy and ketamine.