Images have been released by the British Transport Police showing young children, narrowly avoiding being hit by a train as they run across the tracks at Wester Hailes station.
This is one of a series of incidents which has seen young children, some as young as five running across the train tracks.
The images show one near-miss involving a First TransPennine Express train from Edinburgh to Manchester Airport where two boys aged nine and ten were seconds from being hit.
The British Transport Police have announced that they have increased their patrols and that they have been visiting local schools informing children of the danger.
PC 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.
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.