A man with no driving licence hit speeds of 106mph on the A92 then tried to escape from pursuing police vehicles in a chase through the Kingdom.
Daniel Morrison, 20, sped from town to town, went around a roundabout in the wrong direction, drove on the wrong side of roads and slammed on his brakes, trying to cause a police car to collide with him.
The high-speed chase took him past Cowdenbeath, Mossmorran, through Burntisland and Aberdour before he was brought to a halt by police in Dalgety Bay.
Morrison, formerly of Dysart, now of Whitrose Terrace, Methil, appeared from custody at Dunfermline Sheriff Court.
He appeared for sentencing having previously admitted driving dangerously on December 28 on various roads including the A92 between Lochgelly and Cowdenbeath, the A909 near Mossmorran, the B9157 Orrick Quarry road and the A909 Bernard Smiddy road.
Morrison also admitted he drove without holding a licence and had no insurance.
He further admitted failing to turn up for a previous court appearance.
Sheriff James MacDonald told Morrison: “This was truly appalling driving.
“You were perhaps under the illusion you were invincible. Perhaps you were thinking you were the star of your own show.
“You were endangering the public. We could have been dealing with the loss of life.”
He imposed a community payback order with two years’ supervision and 300 hours of unpaid work.
Morrison was also banned from driving for four years and until he passes the extended test.
Depute fiscal Dev Kapadia said at 11.05pm police were carrying out speed checks on the A92.
A Vauxhall Vectra being driven by Morrison was recorded at 106mph resulting in police following him.
The police activated their blue lights but Morrison failed to stop.
During the pursuit Morrison hit speeds of up to 90mph in a 60mph limit on the A909.
Morrison then drove at speeds of 60mph in Burntisland High Street before heading to Aberdour and into Dalgety Bay, where he went around a roundabout the wrong way.
A second police vehicle arrived on the scene putting itself in front of Morrison’s car.
He struck that police vehicle as he tried to overtake it before being brought to a halt.
Defence solicitor Elaine Buist said her client did not turn up for his previous court hearing because “he was scared he was going to get the jail”.