A 52-year-old man has been given a second chance after posting a naked picture of his girlfriend online and threatening to put posters up of her around Dalry.

Daniel McLurg, of Collingwood Terrace, Gourock, appeared at Kilmarnock Sheriff Court last week. He pled guilty to behaving in a threatening or abusive manner at an address in Dalry and elsewhere.

The court heard that McLurg had been in an “on and off” relationship with his partner for around six months when it came to an end last July.

On September 28 McLurg sent his then ex-girlfriend a What’s App message threatening to post intimate images and videos of her on social media and put posters of her all over Dalry.

The following morning, shortly before 6am, the woman received another message from McLurg, which left her “embarrassed and in shock”. It asked her to look for her pictures on exgirlfriends.com and called her “a f****** tramp”.

At 7am she received an email from her Google account stating McLurg had shared an album online. There was an attachment which led to a Google profile with an image of her.

A further message arrived via What’s App containing the same image with the caption “Mmm”. The woman did not respond. She went to work and was observed by her colleagues to be upset. Police were then called.

The messages were traced to McLurg’s IP address and then his home some months later. By then, he and the woman had resumed their relationship. McLurg was arrested last month at Glasgow Airport returning from a holiday with the woman.

Defending McLurg, solicitor Graeme Cunningham said: “I actually have a letter from the complainer and the relationship is back on track. She is embarrassed about it and wants the matter to go away.

“He deeply regrets that behaviour. He has made amends with her. It’s taken some time to come to court and it’s perhaps unfortunate that it comes just as the Scottish Government has changed the law to be more strict on sharing intimate images.

“He is a genuine first offender. There will be no more repeats of this. He made full admission to the police about his conduct and he’s pled guilty at the first opportunity. He accepts he’s done wrong. It’s an action that wasn’t thought through. While it might be described as vindictive there is no sexual element to it. His position is that it really was a moment of madness and he shouldn’t have done it. There is also the fact of the passage of time and that the lady is still involved in a relationship with him.”

Sheriff Craig Harris said: “Mr McLurg, this is quite atrocious behaviour. I think you now recognise that yourself. I will consider the particular circumstances in this case. I have to take reference that the lady involved has forgiven you and is in a relationship with you again. I’m going to keep a careful eye on you. I want to make sure that even if this relationship doesn’t proceed that nothing like this happens again.

“Having considered the Sexual Offence Act I am satisfied there is not any sexual element to this.”

Sentence was deferred for McLurg to be of good behaviour until May 29 next year. He was ordained to appear on that date.