Nathan Barker, 21, was reportedly drunk and high on drugs when he wandered onto the train tracks at Bentley Station in South Yorkshire, UK, this week.
Train station surveillance footage (video below) shows Barker walking onto the tracks and waving at an approaching train, notes Mediaite.com.
Fortunately, the train engineer used the emergency brakes and stopped the locomotive a few feet ahead of the alleged drunk.
Barker eventually got back onto the train station platform where he was arrested by police.
"The driver of a train arriving at the station had to apply the emergency brakes when he spotted Barker stood on the train tracks with his arms in the air," Sgt. Steve Down, of British Transport Police, told the Daily Mail.
The Metro UK reports that Barker's prank delayed 12 trains for 90 minutes.
Barker was sentenced to 16 weeks in jail for this stunt.