A burglar who stole to feed his heroin habit appealed to police to jail him so he could get help for his addiction.
Simon Sullivan, 37, walked into Brighton Police Station to confess to a string of crimes.
He told surprised officers he wanted treatment to help him combat his habit and admitted stealing to get back into prison.
Sullivan was jailed for ten months after pleading guilty at Lewes Crown Court to two burglaries.
He asked for another offence to be taken into consideration.
Judge Charles Kemp told Sullivan he had an appalling record and if he continued to steal to buy drugs, his future looked bleak.
The judge said: "I am delighted to hear you have resolved to kick the problem. But you have got to understand you cannot regard the court service and the prison service when it comes to drug rehabilitation efforts as a sort of charity that you clock into when it suits you.
"Committing offences of dishonesty to get yourself into prison is not a very responsible way to go about your life."
Judge Kemp told Sullivan he hoped he would take advantage of any drug treatment offered while he was serving his sentence.
Nicola Palmer, prosecuting, told the court Sullivan went to the police station in February and told officers he had only been out of prison for a few weeks but had begun taking heroin again. He wanted to go back to jail to receive proper treatment.
She said: "He said he had been committing crimes in order to get back into custody."
Sullivan admitted stealing £40 from a staff locker at a bar at Brighton Marina the day before his confession. He said a few days earlier he had walked into the Thistle Hotel on Brighton seafront and stolen two laptops left in a room ready for a presentation. He sold them for £300 worth of heroin.
He had also stolen a new television, still in its box, from the Royal Albion Hotel, Brighton, which he sold for £60 worth of heroin.
The court heard he had 47 previous convictions, including offences of burglary and dishonesty, and had twice been sentenced to drug treatment and testing orders but had breached the orders.
Rossano Scamardello, defending, said Sullivan gave himself up because he was determined to stop his addiction. He said: "His actions underline his commitment to deal with this problem once and for all."
He said Sullivan, of Stephens Road, Brighton, had wanted to be assessed for another drug treatment but this had not been done because of a series of mix-ups and delays.
He said Sullivan, in custody since his confession, did not want to wait months to find out if there was funding for a place in a rehabilitation centre, despite realising the only alternative was prison.
He added Sullivan, who started taking class A drugs 11 years ago, had been a model prisoner.
Comments: Our rules
We want our comments to be a lively and valuable part of our community - a place where readers can debate and engage with the most important local issues. The ability to comment on our stories is a privilege, not a right, however, and that privilege may be withdrawn if it is abused or misused.
Please report any comments that break our rules.
Read the rules hereComments are closed on this article