A 22-year-old man who broke into a house in Felixstowe and threatened a student with a knife has been spared a prison sentence by a judge.

Joshua Hughes, who has been diagnosed with a personality disorder, was one of two men who went to 21-year-old Jordan Fox’s flat in Langley Close, Felixstowe, in June last year, Ipswich Crown Court heard.

Hughes’ co-defendant Alexander Greenan had climbed in through a kitchen window and let Hughes into the property and Hughes had picked up a knife from the kitchen before waking Mr Fox up.

Hughes had questioned Mr Fox at knifepoint about the whereabouts of a man he had a grudge against and before leaving the flat Hughes and Greenan removed a number of items belonging to Mr Fox.

Hughes, who has been held at a medium secure hospital since his arrest last June, admitted burglary and assault and was given a three-year community order and a six-month curfew between the hours of 6pm and 8am. Sentencing Hughes, Judge Rupert Overbury acknowledged that he was taking an “unusual” course by not imposing a prison sentence on Hughes.

He described Hughes as vulnerable and said that if he sent him to prison it would undo all the good work that had been done during the last nine months to stabilise his mental state and could have “appalling consequences” for him.

He said Hughes and the public would be better served if he could receive help and support in the community.

“This is probably one of the most difficult sentencing exercises I have had conduct of for a long time,” said Judge Overbury.

He said he had arrived at his sentencing decision after reading numerous reports about Hughes’ mental health.

“Anyone reading them would quickly realise the appropriateness of this sentence,” he added.

Greenan, 21, of Fore Street, Ipswich, admitted burglary and was sentenced to two years’ imprisonment at an earlier hearing.

Steven Dyble, for Hughes, accepted the burglary was “serious” and that a knife had been used to threaten Mr Fox.

He said the knife was taken from Mr Fox’s kitchen and both Hughes and Greenan had been in possession of it at some point during the incident.

Mr Dyble said Hughes had spent the last eight months since his arrest in a medium secure hospital and there was a real risk of him committing suicide if he was sent to prison.