A council road sweeper suspected of stealing fuel drove into a private detective spying on him, a court heard.
A video recording showed Ian Ellis, 52, driving towards private detective Michael Naughton in August 2017.
Ellis, 52, of Deiniolen, Gwynedd, pleaded guilty to theft of diesel from Gwynedd council and careless driving of the sweeper.
He was ordered to do 120 hours of unpaid work at Caernarfon Magistrates' Court.
In a video recording played to the court, Mr Naughton could be heard crying out "ow" and saying: "The target has just driven over me and knocked me to the floor."
The prosecution said Ellis's dishonesty began in May and ended when he was caught on 9 August in Bangor.
Diane Williams, prosecuting, said the council had hired private detective Mr Naughton because Ellis was suspected of siphoning fuel from the council vehicle.
A GPS tracking device was fitted to the sweeper and that day, Mr Naughton had been watching him from behind a stone wall and saw he had a grey hose to siphon fuel.
But the prosecution said Ellis apparently spotted Mr Naughton, who had called the police and then confronted the council worker
Mrs Williams said the sweeper was driven towards the private detective.
"Mr Naughton believed the defendant intended to run him over," she told the court.
Ellis was arrested at his depot.
Sion Hughes, for the defence, said Ellis was "deeply ashamed" and had "no intention of causing any harm".
"He was in a panic," he said.
The court heard Ellis, who had to resign from his job of 17 years, stole the fuel due to his financial situation at the time.
He was also fined £300, given eight penalty points on his licence, and told he must pay £22 compensation for the theft and £170 costs.