A man who hit a pal with a glass tumbler during a drinking session has been jailed for 16 months.
Police investigating the disturbance in Wishaw found the victim with blood pouring down his face.
Declan Orpin, 28, appeared from custody at Hamilton Sheriff Court this week.
He admitted assaulting a man at the victim's home in Kirkhill Road on September 8 while on bail for another matter.
Orpin also admitted assaulting a police officer and subjecting officers to threats and racist abuse.
Jennifer McCabe said the men had been drinking all day with another friend.
Around 6pm, Orpin began to "act erratically" and was asked to leave the flat, but refused.
Ms McCabe told the court: "The victim then asked him to quieten down but Orpin struck him on the head with a glass, causing a wound.
"At this time police officers attended after an anonymous report of a disturbance.
"The victim answered the door. He was seen to have a cut to his forehead and there was blood running down his face."
Orpin was in a bedroom, holding a glass jar that he refused to put down. He was hit by a police baton before being restrained.
He then tried to bite an officer and spat at him several times.
Orpin needed hospital treatment after he hurt himself headbutting the police vehicle.
The fiscal added: "He made threats to officers such as 'I'm going to find out where you live, rape your family and set your houses on fire'.
"He also made racist comments to an officer."
Defence agent Sandy Morrison said Orpin had taken so much alcohol and street valium that he had "no recollection" of the incidents.
The solicitor admitted: "His behaviour towards his friend was unacceptable. He can't believe he acted in such a manner towards the police."
Sheriff John Speir told Orpin his criminal record was "shocking" for a young man as was his behaviour on this occasion.
The sheriff cut the sentence from 24 months to 16 because of his guilty pleas.
**Don't miss the latest headlines from around Lanarkshire. Sign up to our newsletters here.
And did you know Lanarkshire Live is on Facebook? Head on over and give us a like and share!