A 35-year-old man was ordered to return to England and stay out of Scotland - but ended up in Fife.

Ryan McLaughlin claimed he had got on the wrong train in Edinburgh and when he got off in Dalgety Bay he was soon in more trouble.

He went to a nearby filling station where he caused a disturbance after trying to walk out with beer without paying. McLaughlin was arrested and he committed further offences after being taken to Dunfermline police station.

McLaughlin was jailed when he appeared from custody at Dunfermline Sheriff Court.

McLaughlin, of Boole Heights, Bracknell, admitted that on November 16 and 17 at St David’s Bay and Harbour Drive, Dalgety Bay, he acted in a racially aggravated manner towards a man.

He shouted and swore at him, made threats of violence towards him, used racially offensive language and behaved in an aggressive manner.

On November 17 at Dalgety Bay train station and in a police vehicle from Dalgety Bay to Dunfermline police station, he repeatedly struck his head against a police van cell wall, repeatedly kicked the inside of the van wall and repeatedly spat at the door and on the floor of the vehicle.

He used racially offensive language, made threats of violence, made homophobic remarks, attempted to strike his head against a Perspex screen, spat on the floor at Dunfermline police station and acted in an aggressive manner.

Depute fiscal Amy Robertson said the incidents occurred after McLaughlin had appeared in court in Edinburgh on November 16.

He was released with a bail condition that he returned to England and stayed out of Scotland, apart from court appearances.

However, at 11.30pm that night he was in Dalgety Bay where he was stopped from walking out of a filling station with a crate of beer. He then started shouting abuse at a male worker and the police were contacted.

Defence solicitor Alan Davie said: “For some reason he got on the wrong train, coming north instead of south and got off in Dalgety Bay when he realised this.

“He knows his behaviour was thoroughly inappropriate and he regrets that.”

From the dock, McLaughlin said: “I can’t remember any of that.”

Sheriff Wylie Robertson jailed McLaughlin for nine months.