A man breached a restraining order within hours of being released from prison by messaging his ex on Facebook with a line of apology from a Justin Bieber song.

But Ethan Keating who referenced the Canadian singer's UK number one single Sorry had even more reasons to be regretful when he was sent to prison for three months by Judge Niclas Parry, who asked him: “I don’t know if Justin Bieber has got a song called ‘You are stupid’.”

Mold Crown Court was told that Keating was convicted of stalking and making threats to kill Megan Saxon for which he received a 21-month sentence in May 2017.

He was released on Christmas Eve last year, but he was soon contacting his former partner.

Prosecutor Simon Mintz said: “He sent a Facebook Messenger message to her saying “Is it too late now to say sorry?” He said he was joking and that she should block him, but added “I cannot go back to prison”.

In the early hours of the next day, Christmas Day, Keating sent another Messenger message to his ex-partner’s mother, which was also in contravention of the conditions of the five-year restraining order he had been issued with at his original conviction.

The message said: “Why are you on my Facebook, ha, ha.”

Megan Saxon, the court was told, “freaked out” when she read the message and was anxious about being approached by the defendant.

When he was arrested, Keating admitted only to sending one of the messages.

But at court the 21-year-old, formerly of Princess Drive, Colwyn Bay, admitted two breaches of a restraining order.

His defence barrister Nic Williams said that Keating had brought his plight upon himself.

However he pointed out that since his sentencing in 2017 his client had only spent six days out of custody.

“There was no direct contact as it was on Facebook and the contact that was made was not threatening or unpleasant,” he said.

“The message was a quote from a Justin Bieber love song.

“It was the euphoria of being released and he had been drinking with someone back at his bail hostel.

“He wants to break the circle of offending and he suffers from depression and has self-harmed.”