A thug attacked a ScotRail employee after shouting racist abuse at Dundee railway station.
Paul Mason had travelled to the city from Fife but was denied the right to return because of his abusive behaviour.
Dundee Sheriff Court heard the 30-year-old dangled his legs over the side of a platform and pushed a barrier to the ground.
Mason also punched a staff member who tried to stop him on the body.
The court was told staff were informed of Mason, of Mellor Court, Rosyth, sleeping in a waiting room just after 8.30pm on the evening in question.
Attempts were made to rouse Mason, who after being awoken, shouted: “F*** off. I’m not going anywhere.”
Mason later crawled under one of the barriers before becoming aggressive, stating that he needed to travel to Kirkcaldy to see family.
Fiscal depute David Currie said: “He sat on the edge of the platform. The accused then screamed ‘you can’t f****** stop me from travelling you black b******.’
“The accused threw a punch with his left hand at the witness. The witness was very stressed and upset following the incident.”
Mason threatened to jump on to the railway lines before pushing over a barrier.
Police later arrested Mason who replied: “You f****** black b*******. Get your dirty black b********g hands away from me.”
Mason pleaded guilty from custody to repeatedly shouting, swearing, sitting on a platform, dangling his legs over the side of a platform, refusing to desist and pushing a barrier to the ground on January 22.
He also admitted assaulting Ian Watson by punching him on the body.
Sheriff Jillian Martin-Brown deferred sentence on Mason until February for reports to be prepared. He was released on bail.
To better understand how our court reporting works, click here to view our online guide.