Entertainer Michael Barrymore was found with cocaine in his pocket after launching a foul-mouthed tirade at police, a court heard today.
The TV star was arrested in the early hours last month after officers spotted a Citroen DS3 that had been damaged in an accident and found him at the scene.
Appearing in the dock today, the 59-year-old admitted possessing the class A drug and was fined a total of £780.
Dressed in a dark suit, white shirt and maroon tie, he appeared shaky as he entered Ealing Magistrates' Court in west London.
After giving his real name of Michael Parker, he listened intently as prosecutor Sally Peters told of his behaviour on November 22.
Police officers had approached him when they discovered the scene on The Vale in Acton, west London, she said.
Asked who had been driving the vehicle, he replied "I am not answering you", the court heard.
Then, in an expletive-laden outburst, he went on: "Don't you think I've had enough f****** s*** from you lot over the years? I know the law."
Arrested and taken to a police custody suite, he tried to conceal what looked like a white substance in his mouth, Ms Peters said.
"He refused to spit it out, was strip-searched and a rock of cocaine was found in his pocket," she told the court.
A test found him positive for the class A drug.
Barrymore's lawyer, Richard Gowthorpe, reminded the court that the quantity of the drug involved had been described as "a very small amount" and that the entertainer had apologised to the police for his behaviour.
While he now had a criminal conviction, his client had entered the court a man of good character, he noted.
"In many ways it's a sad day for Mr Parker to be before the courts and he's pleaded guilty to this offence," he said.
"Certainly he will be punished to a degree by the conviction itself."
Barrymore had urged his lawyer to point out that the evening in question had been "exceptional" and that "there was an exceptional set of circumstances" at the time, Mr Gowthorpe added.
"This behaviour is wholly out of character. This is not part of a general lifestyle that Mr Parker is living. He's addressing the problem, he's addressing the temptation and there's no present drug use."
The court heard that Barrymore had been seeing a drug worker since the night of the incident and was making "very good progress".
Drug worker Andrew De Cruze said: "Steps have been put in place to support Mr Parker in any way we can.
"He's undergoing cognitive behavioural therapy. It's something Mr Parker has found very helpful and is willing to engage further in that process."
Barrymore was also addressing his alcohol use and had been attending Alcoholics Anonymous meetings, Mr De Cruze told the court.
"I would say Mr Parker is doing everything he can to address the issues," he added.
Chair of the bench Moira Edmonds told Barrymore he would be fined £680 for the offence, plus £85 for prosecution costs and a £15 victim surcharge.
A second charge, of being drunk and disorderly, was withdrawn.