A teenager who launched a firework at a police vehicle on Bonfire Night was caught by cops after a foot chase.
Connor McLeod aimed the firework at the vehicle as officers responded to an incident near a sports centre in East Lothian.
The device exploded just two feet away from it.
McLeod, 19, was excused attendance at Edinburgh Sheriff Court yesterday but his guilty plea was accepted in his absence.
Fiscal depute Jack Caster said officers in Tranent were dealing with antisocial behaviour in the town last November 5.
He said officers were in a police vehicle in Blawearie Road and had attended reports of an incident at the Loch Centre.
Mr Caster said: “A lit firework was set off. It landed approximately two feet from the vehicle and exploded.
“The officers took evasive action within the vehicle.”
Mr Caster said the officers spotted three youths nearby, including McLeod, and identified them as potential culprits.
He added: “After a short foot chase, the youths were apprehended.
“The accused admitted his part in lighting and aiming the firework.”
Defence agent Mary Moultrie said her window cleaner client’s offending could be put down to “immaturity”.
Ms Moultrie said first offender McLeod was “apologetic from the outset” over his actions.
Sheriff Douglas Keir said McLeod, of Tranent, could “thank his lucky stars it wasn’t more serious”. He fined him £150.