A student said to be suffering a breakdown turned violent when police officers arrived at his accommodation to help him.
Jude Boslem started spitting and bit one officer during a struggle, Hamilton Sheriff Court was told.
Boslem, 19, admitted acting in a threatening or abusive manner at Hamilton's Caird Park residences on September 9 last year.
He also admitted culpably and recklessly spitting and assaulting an officer by biting.
Jennifer Cunningham, prosecuting, said police received a call that Boslem was "having a mental breakdown".
They found him lying on the floor of his room with a small knife at his side.
Ms Cunningham told the court: "He had a fresh wound to his finger and was crying uncontrollably.
"The police officers requested an ambulance. The accused then tried to lock himself in the bathroom and officers removed alcohol from him.
"He began to shout and swear at them. The officers tried to handcuff him and he struggled and spat, with spittle landing on one officer's face.
"Several other officers attended and the accused bit one of them on the hand.
"Boslem was then taken to hospital and en route he was still shouting and swearing.
"He refused to cooperate with hospital staff and was advised to return when sober. He was then held in custody at Motherwell police station."
Defence agent Elspeth Forrest said Boslem has had addiction and mental health issues for a number of years.
She added: "There have also been family difficulties.
"He seems to have gone completely off the rails about the time of this incident. There have been other court matters and he is currently on a community payback order.
"However, he is now working as a labourer and is addressing a number of issues."
Sheriff Andrew McIntyre deferred sentence until January for background reports and Boslem had his bail continued.
**Don't miss the latest headlines from around Lanarkshire. Sign up to our newsletters here.
And did yo u know Lanarkshire Live is on Facebook? Head over to our page to give us a like and share.