A man carried out a random attack on a shop worker before going on a "bizarre" street rampage with a hunting knife.
Andrew Riley punched the victim in the face outside a food store in Wakefield then ran at passing cars with the weapon as members of the public fled in fear.
-> Three men appear in court charged with murder of Leeds man gunned down outside his mother's home
Leeds Crown Court heard the incident happened on April 6 this year outside the European Food Store, on Agbrigg Road.
Riley, 32, walked up to the woman as she was helping with a delivery and punched her without warning.
He then pushed her to the ground and dragged her along the pavement, causing bruising and grazes to her arms.
The woman managed to get free and ran back to the shop to get help.
Louise Pryke, prosecuting, said Riley then appeared at a bus stop across the road holding a large hunting knife.
He made stabbing gestures as he held the weapon then ran out into the road.
Car drivers had to swerve out of the way and people who witnessed the incident ran away in fear.
Ms Pryke said a woman then approached Riley and took the knife from him.
Police arrived and went to a house nearby where the same woman handed two more knives to officers.
Riley came out of the house and was arrested.
The defendant said he could not remember the incident when he was interviewed.
Riley, whose address was given in court as a church in Wakefield, pleaded guilty to common assault and possession of an offensive weapon.
Riley has previous convictions for being drunk and disorderly and possessing cannabis.
Michael Collins, mitigating, said: "It is a deeply troubling offence. He behaved in a way that can be described as bizarre and frightening.
"There has been a history of mental health difficulties."
Judge Robin Mairs adjourned the case to allow for a full psychiatric report before Riley is sentenced.
He said: "What concerns me about this offence is the randomness of it and the brandishing of a knife.
"You do not have to go far in this building to find cases where people who have brandished knives have brought about tragic consequences.
He added: "Andrew Riley, your offending troubles me because there appears to be nothing that led up to this."
Riley will be sentenced on January 11.