A man faces a crown court judge after admitting his part in a town centre fight where he brandished a knife.
Robert Joseph, of Greenside Avenue, Waterloo, appeared before Kirklees magistrates.
He pleaded guilty to offences of possessing an offensive weapon in public, affray and possessing a controlled drug of class A.
Andy Wills, prosecuting, said that police were alerted to a brawl in New Street in Huddersfield town centre at 5.30am on November 16.
This was captured on CCTV footage supplied by Kirklees Street Watch.
Mr Wills said: “It showed a group of males fighting in the street. This group dispersed and officers involved went to deal with another emergency.
“The defendant was observed with the knife in his hand and he ran up to one of the males involved in the earlier fight.
“The defendant is seen making a jabbing motion towards the male and then puts the implement in his trousers.”
Police searched the 26-year-old and found the knife hidden in his waistband.
He was arrested and transported to Halifax Police Station.
While Joseph was in the custody suite a bag containing a white powder revealed to be cocaine was found on him.
Further drugs were found in his room at his home, the court heard.
Joseph’s solicitor Bob Carr said that the incident followed his client’s brother being assaulted.
Mr Wills asked magistrates to commit the case to Leeds Crown Court for sentencing.
He said that the affray and the fact that the knife was used in dangerous circumstances aggravated the matter.
Joseph will be sentenced by a judge on December 30.
In the meantime he is banned from entering Huddersfield town centre between 7pm and 7am.