Ryan Sweeten, 19, of Glasgow, was given a year-long football banning order for attacking a Rangers fan while at a match against St Johnstone in Perth.
Sheriff Lorna Drummond said Sweeten should be barred, even though the attack had nothing to do with the match he had been attending. Sweeten ran at Rangers fan Paul Swan and tried to lash him with a belt after his rival called him a "fenian b******."
Solicitor Neha Sood, defending, said: "The racial slur made was the reason he committed the offence. His behaviour was unconnected to the football match itself."
The ban prevents Sweeten from going to any senior football match in Scotland, Wales England, or abroad. He was also fined £250.