Transport police have issued urgent warnings after children as young as five were spotted playing on rail tracks.

In one incident two boys aged around 10 avoided being hit by a high-speed train at Wester Hailes station in Edinburgh by just a few seconds.

Children aged between five and 11 have been seen running across the railway line and jumping off platforms at the same station in recent weeks, British Transport Police (BTP) said.

Officers have now increased patrols in the area and visited local schools to raise awareness of the potentially fatal consequences of trespassing on the railway.

Constable Niall Bonnar said: "Children, mostly young boys, have been captured on CCTV running between the platforms at the station, and astonishingly back again, as well as walking off the end of the platforms.

"The real dangers of trespassing have been highlighted by these recent incidents and as well as being extremely dangerous and illegal, there is the distinct possibility that services will be delayed as a consequence.

"Trespassers also need to be aware that there are 25,000 volts passing through overhead power lines.

"This is more than enough to kill and you don't even need to touch the cables to be electrocuted as the electricity can arc up to several feet."

ScotRail said it "fully supports" the efforts of BTP to reduce trespassing.

Mr Bonnar added: "It is enormously worrying that primary-age children are putting themselves in grave danger by trespassing.

"The children seem to be oblivious to the risks that trespassing and playing near the railway presents.

"They also seriously endanger the safety of others working and travelling on the railway, and the foolishness of their actions cannot be underestimated."

Police are also urging parents to be aware of the dangers on the railway.

Mr Bonnar said: "Please make sure your children are aware that the railway is an incredibly dangerous environment and remind them to stay away from the rail network.

"Those children seen trespassing may believe they can cross the tracks before a train comes, however all it takes is for them to accidentally slip and they will not be able to get out of the way in time.

"Children need to understand that what may seem to them as a shortcut may actually cut their life short."