A bare-chested man armed with an axe ran at people outside a supermarket, a court heard.
Shamus Hussain grabbed the weapon from a waiting taxi and used it to threaten the men in the row outside Asda in Dewsbury.
Magistrates heard the 29-year-old had warned his GP that an “episode” was about to occur hours before the incident on July 29.
He faces sentencing by a crown court judge after pleading guilty to charges of affray, possession of an offensive weapon in public and criminal damage.
Kirklees Magistrates’ Court heard that police were called following the fracas in the car park of the Mill Street West store.
Stephen Rushton, prosecuting, said that there was a disagreement inside the store which led to the parties exchanging blows.
He told the Huddersfield court: “Mr Hussain then exited the store, went to a taxi waiting for him and obtained an axe from inside the taxi.
“Then bare-chested he ran towards the other males and threatened them with it,”
Police were called and agitated Hussain, of Pilgrim Crescent in Dewsbury Moor, was taken to Dewsbury and District Hospital.
While was in admissions he headbutted a perspex security screen, damaging it.
The court heard that Hussain had a previous conviction from 2011 for possession of a knife in public.
Paul Blanchard, mitigating, said that his client was suffering from mental health issues.
He explained: “The evening of the incident he had called his GP stating that an incident was about to occur.
“It did occur when he arrived at the Asda store, him running around the car park brandishing an axe.”
Three other men were arrested at the scene but were subsequently released without charge.
District Judge Michael Fanning told Hussain: “This is a serious matter.
“In everyday life you don’t bring an axe to Asda.
“The most this court can impose is six months in custody - it strikes me the sentence you will receive will be in excess of that.”
Hussain was committed for sentencing to Leeds Crown Court.
He will appear there on December 23 and was banned from going to the Asda store in Dewsbury.