James Begbie, 19, from Kirkliston, had already been punished for threatening Celtic fans on an away trip.
And on October 15 he managed to gain access to Dunfermline’s East End Park, a game Hearts won 2-0, through a disabled gate, after which he embarked on the bigoted singing.
However, at Dunfermline Sheriff Court yesterday he was told he would probably be spared time behind bars because the offence did not take place around Celtic fans.
Prosecutor Azrah Yousaf said: “This man was already subject to a club ban which prevented him attending games at Tynecastle.
“At about 10 past four in this match police became aware of a group of supporters in the disabled area of the ground.
“The accused was heard singing on his own a Hearts song called The Gorgie Boys. It is sung to the tune of the loyalist song The Billy Boys.
“He sang ‘We’re up to our knees in Fenian blood, surrender or you’ll die.’
“Fans around him were becoming unrestful about the words he was singing, and he was taken out the ground.
“Police had initially refused the man entry to the game because he was seen as a high risk supporter. He left the stadium but was seen to enter via the disabled access.
“He has another conviction for a football related matter.”
He admitted the sectarian abuse charge and religiously prejudiced breach of the peace, but said he did not consider himself bigoted.
Sheriff Craig McSherry said: “If he was saying this at Celtic Park would this maybe be a greater aggravation, I wonder?”
“Taking into account the weekend you spent in custody and that there is no evidence this was directed at opposing supporters. In the circumstances I will defer sentence for good behaviour for three months.”