A 51-year-old Derry man claimed to be ‘Bruce Lee’ before throwing a punch at a female police officer.
Christopher Woods, from Glendermott Road, Derry, is charged with disorderly behaviour and assault on police for incidents that took place on August 4 of this year.
Woods pleaded guilty in respect of both charges.
The defence solicitor said the defendant accepts he has an alcohol problem.
Referring to the age of the defendant, he said there are significant gaps in his record.
District Judge Paul Copeland said: "This man is working towards a custodial sentence."
The court heard it had been some time since the defendant's last court appearance.
Outlining the case, a representative of the Public Prosecution Service said it took place at 12.30pm at the Waterside Library.
Woods was intoxicated inside the premises and refused to leave when asked to do so by members of staff.
When police arrived the defendant left of his own accord.
Police officers approached him outside at he began shouting at them.
He was warned about his behaviour as there were children in the vicinity.
Woods told police officers he was going to 'rip their heads off'.
He said: "I'm a f*****g ninja, I'm Bruce Lee."
The defendant was once again asked to calm down, to which he replied: "I'm a f**king ninja, I'll show you."
At that point the defendant threw a punch at a female police officer which made 'minor contact as it flew past her face at speed'.
The defence solicitor for Woods said that he is in contact with his GP and is being referred for counselling and alcohol treatment.
He is due back in court on October 14 for a pre-sentence report.
Judge Copeland said: "You have a significant record for this type of behaviour, you would do well to behave yourself."
If you have a story or want to send a photo or video to us please contact the Derry Now editorial team. Between 9am and 5pm Monday to Sunday please call 028 7129 6600 for Derry City stories or 028 7774 3970 for County Derry stories. Between 5pm and midnight please call or text 07825 711978. Or you can email john.gill@derrynews.net at any time.