Pete Doherty has been warned he could face jail again after he pleaded guilty to possession of cocaine.
The Babyshambles frontman, who is about to embark on a tour of the UK and Ireland, was arrested in January last year by police investigating the suspected overdose death of heiress Robyn Whitehead.
The 27-year-old film-maker spent the last 10 days of her life creating a documentary about the musician.
Looking clean-shaven in a dark blue two-piece suit and cravat, Doherty, 32, appeared at Snaresbrook Crown Court, east London, alongside two friends for the 20-minute hearing.
Peter Wolfe, 42, of Heath Road, Maidstone, pleaded guilty at the hearing to two counts of possession of cocaine and one count of supplying cocaine to Miss Whitehead, who died at his east London flat.
Alan Wass, 29, of Bramley Road, west London, pleaded not guilty to the charge of possession of cocaine.
Judge David Radford described Doherty's criminal record as "unattractive".
Addressing the musician's lawyer Peter Ratliff, the judge said: "When someone constantly commits the same offence the law must be made very clear. Is your client aware he could face a sentence?"
The judge granted Doherty unconditional bail. But the singer and Wolfe, who was granted bail on the condition he sleep at his home in Maidstone, were ordered to return to the court for sentencing on May 20, when Doherty is due to still be touring.
Doherty, who seemed physically shaken, stroked the back of Wolfe's head as he broke down in tears outside the courtroom.