A 17-year-old boy has been given an Anti-social behaviour order after he promoted yobbish behaviour online.
The boy, from Norfolk, posted comments which glorified criminal exploits on networking website Bebo, police said.
District Judge Philip Browning at Norwich Youth Court banned the boy from using the internet to publish material that "promotes criminal activity".
The boy who also admitted stealing a vehicle and possession of cannabis was given the order for two years.
A police investigation found the boy had posted photographs of drug-taking on the website alongside offensive comments against police officers.
Pc Tim Chapman, of Norfolk Police, said: "The comments on the website demonstrated his attitude towards offending the community and the police."