A 39-YEAR-OLD man locked himself in the toilets at the Galashiels Transport Interchange and refused to come out, Selkirk Sheriff Court has been told.

John Fernon had been involved in a disturbance the previous day at the Co-operative store in Melrose when he was in possession of a hammer and after being arrested and taken to Hawick Police Station he challenged two police officers to fight.

Turning to the events at Galashiels Transport Interchange on February 5, an inspector noted a man smoking a vape pen in the male toilets area around 4pm.

READ MORE: Borders man convicted of assault to severe injury and danger to life is jailed

Joanne Waller, prosecuting, said: "The accused was told to stop smoking and the accused became threatening towards the inspector. He raised his voice and said to the inspector, 'I’m from Glasgow you f****** b*******. Go back to your own country'."

The fiscal said Fernon, who gave an address in Motherwell, called the inspector a Pole thinking he was Polish which was wrong.

At around 4.50pm Fernon approached the inspector and attempted to apologise but the inspector said he was not interested.

Fernon became aggressive again and called him an 'English b******' on a number of occasions.

READ MORE: Borders man admits threatening or abusive behaviour towards 17-year-old girl

Ms Waller continued: "The accused then barricaded himself into the toilets and said, 'F*** off, I am not coming out. I am going home, you will have to drag me out'.”

The fiscal said the inspector told police officers he was going to get a tool to force open the door and the accused then opened the door and was taken by the right arm by the officers and he began to pull and resist and was taken to the ground.

Ms Waller said Fernon was handcuffed and was abusive to the police officers by shouting and swearing.

Fernon’s lawyer said her client was going through a difficult period in his life with his mental health suffering and was mixing with the wrong type of peers.

READ MORE: Plans backed for new 24-hour gym to fill empty unit at Galashiels retail park

She added: "He has made changes in his life and is taking no substances like drugs or alcohol and he is doing a lot better.

"He was embarrassed about his behaviour at the time."

Sheriff Peter Paterson ordered Fernnon to carry out 140 hours unpaid work as part of a Community Pay Back Order and also imposed a Restriction of Liberty order between the hours of 7pm and 7am for the next seven months.