Pete Doherty escaped going to jail today after pleading guilty to multiple charges of drug possession.
The 27-year-old Babyshambles frontman looked relieved as he was told he would not be going to prison.
He was sentenced to a community order with two years supervision and 18 months drug rehabilitation at Thames Magistrates' Court in east London. He was also banned from driving for six months.
District Judge Jane McIvor said his road to recovery from drug addiction would be long and difficult.
She said:
"It is going to be a long and slow process but you are showing significant signs of compliance and effort." 
But she warned that if he were to breach the order, he might face time in prison.
Doherty, who was wearing jeans, trainers, a black jacket and holding a brown overnight bag, was mobbed by photographers on arriving and leaving the court. He looked dazed as he stepped into a black London cab and sped off.