ScotRail staff are to be offered CCTV cameras to wear on duty after a trial found it improved passenger behaviour.

The cameras can be clipped onto uniforms or worn on a cord around the neck, and are marked as CCTV to make people aware they are being filmed.

Staff will be encouraged to wear the recorders, but it is not compulsory.

An 18-month trial with 36 cameras found they reduced anti-social behaviour on trains and some footage has been used in prosecutions.

Transport Scotland and trade unions ASLEF, RMT and TSSA have been involved in the initiative and ScotRail has spent £300,000 to increase the number of cameras available.

Alex Hynes, ScotRail Alliance managing director, said: "We are building the best railway that Scotland's ever had, and a key part of that is continuing to improve the safety of our railway. The safety and security of our staff and customers is our priority.

"Anti-social behaviour will never be tolerated at our stations, or on our trains.

"These new cameras will improve everyone's journey by deterring anti-social or criminal behaviour, and help with gathering vital evidence on the rare occasions when it does occur."

The cameras made by Edinburgh-based Edesix can film for eight hours and, with a simple on/off record button, do not require training to use.

ScotRail said wearers of the device have no access to the footage recorded, which is downloaded automatically to a secure site.

British Transport Police issued the cameras to officers earlier this year.

Chief Inspector Sue Maxwell said: "Body-worn cameras allows officers to capture essential evidence, help protect officers from malicious complaints and can speed up the justice process.

"With ScotRail now using these cameras, we're sure this is another great step towards making Scottish railways a safer place to travel."

Liz Warren-Corney, TSSA Scotland organiser, said: "TSSA's raison d'etre is all about ensuring our members get home safely to their loved ones after a day at work.

"Keeping them safe keeps Scotland's passengers safe, so we welcome anything that adds to the safety levels and welcome the bodycams."