Three teenagers boarded a train to Glasgow and brandished weapons in front of passengers.

Kieran Gemmell, 19, appeared from custody at Glasgow Sheriff Court last week.

He was in the dock alongside two other youths, who cannot be named due to their age.

The 17-year-olds and Gemmell boarded the Ardrossan Harbour to Glasgow Central ScotRail service at Paisley Gilmour Street on the evening of November 1 last year.

Passengers on the train saw Gemmell carrying a hammer. Meanwhile, the other two youths had a Buckfast bottle and a baseball bat.

After the doors closed and the train moved away, the three of them started banging on the windows and brandishing the weapons.

Police on duty within the station became aware of a commotion. They saw the trio in possession of the items as the train pulled away.

The cops notified the control room and passed a description of them. Someone on the train also contacted the police to report people carrying weapons.

Other officers were told that the train was heading to Glasgow Central and attended immediately, arriving at platform 10, where they were joined by more cops.

READ MORE: Glasgow man punched his dog in the face in front of cops

When the service arrived, an officer drew his taser and activated the red dot. He told Gemmell to kneel down, and he was handcuffed.

Passengers told cops he had been in possession of a hammer, but it had been hidden behind a seat.

The other two teens were also arrested, and passengers said a baseball bat had also been hidden.

Cops recovered the weapons. The trio were taken to London Road police office.

Gemmell’s lawyer told the court he “isn’t going anywhere” due to an alleged conviction.

The other two teenagers also have other cases pending.

READ MORE: Glasgow mum let criminals use her bank account to scam pensioner

Sheriff Allan McKay told them: “There is an alternative to custody.”

They were ordered to carry out 150 hours of unpaid work and be under social work supervision for one year.

Meanwhile, Gemmell, from Paisley, was sentenced to 180 days in prison.

Sheriff McKay told him: “Your circumstances are different.”