Singer Pete Doherty has been spared a jail term after being caught with heroin, crack cocaine and cannabis.
Pete Doherty is a former member of rock band The Libertines
The 27-year-old was instead put on a two-year supervision order by Thames Magistrates' Court, east London, and given 18 months in drug rehabilitation.
The Babyshambles frontman was also banned from driving for six months.
He had pleaded guilty to seven charges of drug possession but Judge Jane McIvor said he was showing "significant signs of compliance and effort".
"It is going to be a long and slow process," she said, warning him that he could be sent to prison if he breaks the supervision order.
The charges followed two arrests in London when he was found to be carrying drugs.
He admitted having 0.406g of heroin, 0.776g of crack cocaine, 0.332g of cannabis resin and 5.94g of cannabis on 18 December in Riverside Close, Clapton, east London.
He was also arrested on 14 January for possessing 3.103g of heroin, 3.664g of crack cocaine and 2.503g of cannabis, this time in nearby Dunlace Road.
His sentencing was postponed to allow the judge to hear how another rehabilitation order he was under was progressing.
He was given a year-long order in February for separate drug charges, which requires him to attend a drug clinic and undergo regular check-ups.
His solicitor, Sean Curran, told the court: "I have noticed a significant improvement in his demeanour. He is fully appreciative of his surroundings and he is able to ask questions.
"He is clearly in a better physical and mental position than he was when he started."
Doherty's exit from the court was once again greeted by a scrum of photographers but this time he opted not to talk the waiting media.
His last court appearance in February descended into a fracas outside the building when he kicked a microphone out of the hand of a BBC Radio 1 reporter.
He must return to court on 31 May for a review of how his rehabilitation order is progressing.