Police negotiators and firefighters were used during the stand-off and a helicopter was deployed after Daniel Hall managed to escape from Pinderfields Hospital, in Wakefield
Hall ripped tiles from the roof and hurled them at emergency workers during the incident in September this year
The 32-year-old eventually gave himself up but then went on to racially abuse a police officer and assault two more when he was taken into custody.
Leeds Crown Court heard Hall was arrested on September 26 on suspicion of a series of burglaries in North Yorkshire.
He was taken to Normanton police station where he staged a "dirty protest" in his cell and told officers he had taken an overdose.
John Batchelor, prosecuting, said Hall was taken to Pinderfields Hospital in handcuffs but managed to escape.
He was missing for 12 hours before officers traced him to his grandmother's home on Westminster Terrace, Bradford.
Hall got onto the roof and refused to come down for 16 hours.
Damage was caused to police vehicles when Hall threw tiles.
The handcuffs were found at the property. They had been cut with an angle grinder.
Hall was eventually returned to Normanton police station where he shouted vile racist threats and abuse at a constable.
He said to the officer: "I will break into your house and tie you up and beat you.
"You won't see my face"
"If I ever see you out and about I will hit you over the back of the head with a bottle."
Hall assaulted two police officers when he was being interviewed about the offences.
One of the officers was left bleeding after being bitten on the hand.
Hall pleaded guilty to two counts of criminal damage, two of assaulting an emergency worker, escape and racially aggravated threatening behaviour.
The court heard Hall was involved in a similar rooftop standoff at the same property in Bradford in 2016.
Imran Khan, mitigating, described Hall as being vulnerable and having a low IQ.
He said: "He is also afraid of being restrained or in a position where he is uncomfortable."
Hall was jailed for 35 months.
Judge Christopher Batty said: "The way you behave towards authority, in particular towards police officers, is unacceptable.
"You may have been unhappy at being arrested but what followed was disgraceful."