A man who harassed his former girlfriend by sending her threatening text messages has walked free from court.

James Brown was put on a 36 week suspended sentence and told to complete a supervision order with a mental health requirement after admitting the offence.

The 36-year-old had been in a short lived relationship with Derry Hill woman Charlotte Chorley before she ended it.

He then sent her a number of threatening text messages which left her in fear of violence, a court was told.

But after hearing how he had spent more than four months in custody on remand a judge at Swindon crown court passed the suspended sentence.

Brown, of Ashley Road, Trowbridge, pleaded guilty to putting Miss Chorley in fear of violence by harassment.

He accepted that on Monday February 4 he sent a series of abusive, menacing or threatening text messages.

Judge Douglas Field said having read a psychological report on the victim he was prepared to pass the suspended sentence.

He told him "This offence arose out of your relationship, albeit short, with a lady. As a result of her bringing it to an end you sent violent text messages which appeared to be violent and aggressive which must have caused her great distress.

"It is sufficiently serious to merit a custodial sentence but I have decided, particularly bearing in mind the psychiatric background, to suspend the sentence.

"I took into account your plea of guilty and you have been in custody for four months and therefore have had ample time to reflect on this behaviour and it must never be repeated."