A driver reached speeds of up to 100mph in a seven-mile chase with police along the A48, Gloucester Crown Court was told.
Samuel Ricketts, of Callamore, Littledean was given a 12-month community order and banned from driving for a year..
Judge Rupert Lowe told the 21-year-old: “This was a disgraceful incident. However it is accepted that you were at a particular low point in your life and started using cocaine, but this is no excuse for criminal offending.
“You were wasting your money on class A drugs and hanging around with others of the same ilk.
“You drove at excessive speeds, reaching 100mph at times, which included driving through the village of Westbury, where anybody could have been in the way and you might have killed somebody.
“This is your one judicial chance. If I see you again it will be a prison sentence.”
Ricketts admitted driving a Vauxhall Astra dangerously on October 20, 2023 at Westbury, drug driving on the same date, having no insurance and failing to stop for police.
Police tried to pull over Ricketts – who was under the influence of drugs – because of the manner of his driving and the vehicle had been flagged as having no insurance.
After initially indicating he was pulling over near Westbury, Ricketts took off on a seven-mile chase reaching speeds of between 80mph and 100mph before crashing into a hedge.
Simon Goodman, defending, said: Ricketts is thoroughly ashamed of his actions, adding: “He did initially pull over when the police asked him to, but decided in his infinite wisdom to drive off again at speed and the pursuit ends shortly after in a crash when he lands in a hedge.
“Ricketts said that everything went dark in his head, probably due to his drug habit at the time.
“He is fully supported by his family and has since gained new employment as a roofer using his qualifications. He is a man who deserves a chance as he is unlikely to trouble the courts again. He has severed his ties with those who led him astray.”