A Tayside man was sent away from a maximum security jail after turning up and demanding a cell for the night.
Michael McConnell wanted to use Perth Prison as a drying-out centre to tackle his alcohol problem but was told by staff they could not take him in.
However, he has now been granted his wish by a sheriff after hurling homophobic abuse during a Dundee’s Gay Pride festival weekend.
McConnell, 50, from Perth, was jailed for 240 days after he admitted smashing a window with a barrel at the Skinnergate homeless unit in Perth on February 24.
Dundee Sheriff Court was told the alcoholic had fallen off the wagon and decided to try to get into prison two days later.
He admitted acting in a threatening or abusive manner by shouting, swearing and directing abuse at police officers at Perth Prison on February 26.
Depute fiscal John Richardson told the court: “He was very heavily under the influence of alcohol.
“Staff simply wanted him away and police tried to remove him from the area.”
McConnell then kicked off at the officers and told them he would “do exactly what he wants.”
Solicitor Jim Laverty, defending, said: “The circumstances of the event at Perth Prison is that it was something of an attempt to cut out the middle man.
“He felt he would be better off the streets and this and the incident at Skinnergate show his behaviour had become particularly problematic.”
McConnell also hurled homophobic abuse at police officers when they woke him up on a bench in Dundee when last year’s Pride festival was taking place.
He admitted committing the offence in Soapworks Lane on September 23.
Sheriff Gregor Murray jailed McConnell and told him: “What concerns me most is that the incidents here involved innocent people who were trying to help you.
“Having regard to your record there is no alternative to a custodial sentence.”