A driver who abandoned a decommisioned ambulance on a level crossing after a police chase "could have caused untold carnage", officers have said.
North Yorkshire Police have released footage of Shane Hughes leaving the vehicle on the crossing and how it came within inches of a speeding train.
Hughes, from Halifax, was jailed for 22 months earlier this week by a judge at Bradford Crown Court, who said it was the worst case of dangerous driving he had ever seen, the force said.
A police spokesman said Hughes led officers on a chase for 37 miles before abandoning the ambulance on the railway tracks at Kildwick, North Yorkshire, on July 13.
The video, shot on the dash-cam of a police car, shows Hughes speeding the wrong way around a roundabout as he is followed by police.
The footage then shows the vehicle crashing through the level crossing barriers before Hughes is seen running away.
Officers can be seen frantically trying to warn a train approaching at 70mph before the service passes at speed, narrowly missing the ambulance.
Traffic Constable Gemma Brett said: "On the day of these offences, Shane Hughes put numerous lives at risk and could have caused untold carnage.
"His actions were totally irresponsible, illegal and focused entirely on himself with no thought whatsoever for the safety of anyone else."
Hughes was also banned for driving for six years and 11 months after pleaded guilty to a number of driving offences and a charge of theft, the force said.