A 21-year-old man was facing jail time after standing on a railway line in front of an oncoming express train.
Andrew Ogden, from Chorley, Cheshire, England, stood directly in front of the train as it approached him at 50 mph.
He waved his arms in the air and only jumped out of the way at the last minute.
The driver of the express service from Manchester Airport to Blackpool was left traumatized by his actions.
He was convinced he had struck and killed Ogden and had to be signed off work with stress.
At the time of the incident, Peter Holden of British Transport Police said it was a shocking case.
"This is plain stupidity and people need to realize that it is viewed extremely seriously," he said.
Andrew Ogden pleaded guilty to obstruction without intent.
He said he had been drinking before the offense and had thought it would be a "bit of a laugh."
He will be sentenced at Preston Crown Court on Jan. 29 and has been warned he could spend up to two years behind bars.