An inmate walked out of a Suffolk prison to avoid the temptation of illegal drugs, a court has heard.

Graeme Shepherd, 41, browsed in the post office and strolled around the village of Hollesley for three hours before being arrested in the grounds of All Saint’s Church on December 11.

On Tuesday, Ipswich Crown Court was told that Shepherd, who is serving an indefinite sentence for robbery, had wanted to get caught.

Shepherd’s barrister Alan Wheetman said: “He has found it difficult in an open prison because of the temptation of illegal drugs.

“He says there is an awful lot of drugs in Hollesley Bay.”

Mr Wheetman said that since 2009 Shepherd has been free of drugs and has undergone regular voluntary testing to support that.

An earlier application by Shepherd to be moved back to a closed prison had been turned down by officials after he refused to name prisoners involved in the supply of drugs within Hollesley Bay.

Mr Wheetman said: “He realised that in order to get away from Hollesley Bay he would have to take some positive action. He realised that anyone who escaped would be transferred back to closed conditions.”

Shepherd had pleaded guilty to an offence of escaping from lawful custody.

His absence from Hollesley Bay was noticed by a prison officer carrying out a morning roll call, said Hugh Vass, prosecuting. Shepherd was found by a police officer in the churchyard of All Saint’s, Hollesley.

Mr Vass said: “He said he didn’t want to go back to drug taking and had done it for his own safety.”

Judge Rupert Overbury sentenced Shepherd to four months imprisonment which will be added to the sentence he is already serving.