The son of actor Jackie Chan pleaded guilty in a Beijing court Friday to providing a venue for drug users and was sentenced to six months in jail.

Jaycee Chan, 32, also was ordered to pay 2,000 yuan, or about $320, the Dongcheng District People's Court in Beijing says on its microblog account.

Police detained Chan, Taiwanese movie star Ko Kai and several others in August in Chan's Beijing apartment. The official Xinhua News Agency said Chan and Ko tested positive for marijuana, and police seized more than 3.5 ounces of marijuana from Chan's home.

"I violated the law. I deserve to be punished. When I return to society, I won't do it again," Chan said in courtroom footage aired on state broadcaster China Central Television.

The maximum sentence for the charge against Chan was three years in prison. The court said it showed leniency in the sentencing because Chan voluntarily confessed.

Police said it arrested more than 7,800 people last summer in Beijing over illegal drug use. Other celebrities, including actor Gao Hu, were also among those detained in what was described as the biggest such crackdown in two decades.

Illegal drug use has ballooned in China in recent decades, after being virtually eradicated following the 1949 Communist revolution.

The trial and sentence were especially sensitive for Jackie Chan, who was named an anti-drug ambassador in 2009, and sits on China's top national political advisory panel -- the Chinese People's Political Consultative Conference. The actor has said that he did not use his connections to interfere with the case and hopes his singer-actor son will eventually become an anti-drug ambassador.

Ko has said on camera that he had used drugs at Chan's home. CCTV also said Chan told police that he has been using drugs for eight years.

Ko, whose real name is Ko Chen-tung, has been released after a 14-day administrative detention for drug use.