A man turned up at his ex-partner's Hamilton home with a knife and threatened to kill her.
Baillie Bancroft brandished the blade and tapped it repeatedly against a window.
Bancroft, 21, a prisoner, appeared from custody via videolink at Hamilton Sheriff Court this week.
He admitted assaulting the woman by grabbing her and trying to pull her by the clothing in Elgin Terrace on November 21.
Bancroft also admitted threatening or abusive behaviour towards his ex-partner on that day.
The court heard he was the subject of two bail orders at the time.
He phoned the woman repeatedly, shouting and swearing during the calls. He also sent offensive texts and tried to call her via Facebook Messenger.
Bancroft then went to Elgin Terrace, opened the front door and shouted abuse.
He refused to leave and was seen in possession of a knife. He brandished this as he threatened to kill her and tapped the window with it.
When police officers arrived and arrested him, he protested his innocence, saying: "I went up to her door, but I didn't pull a knife. My wean stays there."
Defence agent Ali Murray suggested that Bancroft could be ordered to attend a domestic abuse programme as an alternative to further time in custody.
Sheriff Linda Nicolson agreed to consider that option and deferred sentence until June 1 for reports.
Bancroft was remanded in custody.
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!