A BOY could have died an “horrendous” death as he lay down on the East Coast main railway line near York, magistrates have said.

Kathryn Reeves, prosecuting, told York Youth Court that a train thundered past on one track as the 14-year-old boy lay across a second line near Hob Moor.

The boy was taking part in the “planking” craze in which people lie flat in bizarre or dangerous places, and told magistrates he no longer regarded his actions as a joke. He was given a four-month referral order.

Francesca Horsfield, sitting with two magistrates, issued a stark warning against playing on railway lines, as thousands of children prepare to break up for the summer holidays.

She told the boy, from Acomb: “It could have caused untold grief not only to your family, but to others as well, such as the train driver who would have had the horrific experience of watching you being killed in a horrendous manner.

“You committed what can only be described as an act of total stupidity. It wasn’t brave at all.”

The bench gave the teenager a four-month referral order and ordered him to pay £85 prosecution costs after he admitted trespassing on the railway. He cannot be identified for legal reasons.

Ms Horsfield told him: “Your moment of fame is costing you dearly.”

The boy was prosecuted after The Press highlighted the dangers of “planking” by publishing the photo, which a friend had taken of him, on our front page.

Within hours, an anonymous caller identified him to police and he was arrested. Ms Reeves told the court: “This was done as a joke, but the consequences could have been fatal.”

The boy, who represented himself, told magistrates about his actions.

He said: “You don’t realise what you’re doing until you’ve done it.

“It’s not funny when you look at it again.”

He had told police he did it because he had nothing to do and wanted to have a picture of himself doing “something dangerous”.

His father said he was “appalled” by his son’s actions and claimed the people behind an online “planking” page were more concerned about the number of hits it got than their “duty to the public”. Both he and his son believed the “planking” craze was dying down.

Planking has previously been linked to the death of a man who fell from a balcony in Australia.