Footage has emerged of young people risking their lives for the sake of a selfie.

The teenagers were seen climbing onto train tracks at Halifax Railway Station and crouching on the tracks, apparently holding a phone out for a picture.

They then climb back onto the platform shortly before a train pulls in.

The footage was captured on CCTV cameras last summer and has now been released by Network Rail and British Transport Police to warn parents and young people over the dangers of playing on or near rail lines.

Footage shows teenagers climbing onto train tracks at Halifax Station to take a selfie

Figures show that youngsters are more likely to trespass on train tracks during school holiday periods, particularly at Easter and during the summer.

Hayley Bull, community safety manager at Network Rail, said: “The footage is absolutely shocking; young people in particular need to realise that they are risking their lives when they choose to trespass on the railway.

WATCH: Train driver's view from the cab as cyclist misses death by inches

“We invest lots of time and money into keeping people safe on the railway but we need users to do their bit too.

“It may seem harmless to take a shortcut, or fun to play on the tracks, but this is not only illegal, it is also very dangerous. Taking a short cut or messing around on the tracks can result in serious life-changing injuries or death.”