Richard Slattery, of Irvinestown Road, Enniskillen, breached a number of suspended prison sentences when he raised his middle finger to police and called them "f--kers".
He admitted his behaviour was disorderly. He was released on £500 bail pending the outcome of an appeal against the prison sentence.
A prosecutor told Fermanagh Court that at 1am on Monday, June 4, police patrolling the centre of Enniskillen saw Slattery sitting on a bench at The Diamond. He made an obscene gesture towards them with his middle finger and as they were talking to a tourist he called them "f--kers". He appeared to walk off before shouting at the officers: "Scottish f--ker, English bastard." He then ran off towards the Buttermarket where officers found him on a roof. He was warned to come down for his own safety, which he did, but then clenched his fists and told the officers he wanted to fight.
He was placed on the ground and handcuffed. On the way to Enniskillen Police Station he continued to shout abuse at the officers.
Defence solicitor, Mr. Michael Fahy, told the court the disorderly behaviour consisted of an obscene gesture and occasional comment. Slattery was the author of his own misfortune.
"He could have walked away but chose not to do so," said Mr. Fahy.
He suggested that giving Slattery a community service order would allow him to put something positive back into society.
However, District Judge Austin Kennedy said Slattery had an appalling criminal record and jailed him for two months, while also activating suspended prison sentences previously imposed for other offences, for a total of seven months' imprisonment.