Untold carnage was avoided when a 70mph train came within inches of crashing into a a stolen decommissioned ambulance that had been dumped on a level crossing.
Police desperately tried to flag down the train but it was unable to stop when Shane Hughes, 41, crashed the vehicle and fled on foot.
Footage from inside the police car records officers worries about the oncoming train, which can be heard sounding its horn frantically as it fast approaches.
Thankfully the ambulance was on the other side of the track but the train was just inches away from hitting it.
Hughes had stolen the ambulance on his way to a festival while high on cannabis in July this year.
He took police on a 37-mile chase before approaching the crossing with the barriers down and the lights flashing in Kildwick, North Yorkshire.
Hughes crashed through the first barrier, but crashed on the opposite side then jumped out and ran off to be found later hiding in someones garden.
Hughes, from Halifax, West Yorkshire, has now been jailed for 22 months by a judge who described it as the worst case of dangerous driving he had ever seen.
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.
Traffic Constable Gemma Brett, of the Major Collision Investigation Unit who led the case for North Yorkshire Police, 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.
The sentence handed to him today shows that the courts, as well as the police, are determined to keep North Yorkshires communities safe by getting offenders like Hughes off our roads.