A judge ordered rocker Pete Doherty to attend an 18-month drug rehabilitation program Thursday and placed him on two years' probation.
Judge Jane McIvor also banned the 27-year-old Babyshambles frontman from driving for six months because of drug possession.
Doherty had pleaded guilty last month to seven charges of possessing drugs including heroin, crack cocaine and marijuana, which police said they found when he was stopped once in December and once in January.
Prosecutors noted the rocker's flippant — yet open — demeanor when he was arrested Dec. 18, one of a long line of run-ins with police.
Court documents said that when police found plastic bags of crack cocaine in his right sock, Doherty told officers: "I didn't think I had it in there."
McIvor told Doherty she would adhere to his pre-planned drug rehabilitation regimen, choosing the dates of his court-ordered drug tests around his lengthy tour schedule.
"It's a long, slow process, but you are showing sufficient signs of compliance and effort," McIvor said. She noted that Doherty hadn't been arrested for drugs since Jan. 14.
Doherty arrived at Thames Magistrates' Court in a leather jacket, blue jeans and white sneakers instead of his customary wrinkled suit and matching fedora. He was mobbed by reporters and fans when he left court, and police hurried him into a taxi.
His drug problems gained international attention after a newspaper published pictures last year of then-girlfriend Kate Moss allegedly using cocaine at a music studio where Doherty and Babyshambles were recording.
In early February, another judge imposed a 12-month community service order and required Doherty to submit to regular drug tests.
Doherty missed a separate, court-ordered drug review April 12 after he was unable to return from Paris, where Babyshambles had played a concert, his representatives said. That case was adjourned until May.