Thomas Flanigan, 23, from Glasgow, phoned guards at the city’s Barlinnie jail and told them he was waiting around the corner.
In a rambling, drunken phone call late at night, he said he would blow up the prison.
When police were called to his house, Flanigan also threatened to burn down Rangers’ Ibrox home stadium and used sectarian insults.
Glasgow Sheriff Court heard prison guard Robert Cairnie answered the phone to a slurring Flanigan.
After a “rambling” conversation, he was ordered not to call back.
“I will smash your c*** in and I will burn down Ibrox, those Huns”
But prosecutor Lauren Donnelly told the hearing: “Flanigan said he would be waiting on him at the bottom of the road, that he was going to blow up the jail and that he was around the corner.”
Prison guards alerted police, who went to Flanigan’s home in Kelvinbridge to arrest him.
Suddenly, Flanigan became aggressive.
He told police: “You are a bunch of f****** c***s, take these cuffs off and see what happens.”
Flanigan was taken to the police station, where he continued his abusive rant at cops.
Donnelly went on: “He said ‘I will smash your c*** in and I will burn down Ibrox, those Huns’.”
He admitted two charges of threatening and abusive behaviour in June last year.
Sheriff Joan Kerr sentenced Flanigan to an 18-month community payback order as an alternative to prison.
She told Flanigan: “If you stop doing what you have been told then I can still send you to prison.”
Marissa Borland, defending, said Flanigan had been dealing with family issues at the time.
She told the court: “The previous week, he met his father and this opened up wounds in terms of his upbringing.
“It was all too much for him.”