A drunk Fife nurse who was more than six times over the limit missed a pedestrian by a matter of feet when she crashed her car into a wall.
Caroline Paton, from Dunfermline, swerved across the road before mounting a pavement, hitting a wall and ending up in a field near Inverkeithing.
The vehicle narrowly missed a woman who had been walking on a pathway with a friend.
The mum of four was told by a sheriff she was lucky no one was killed and the only thing keeping her out of jail was her long record of serving the community.
Paton, 50, of Kyle Crescent, appeared for sentencing at Dunfermline Sheriff Court and admitted she drove dangerously on June 1 on the B981 North Road, Inverkeithing.
She also admitted drink driving. The court heard her reading was 456 milligrammes of alcohol in 100 millilitres of urine, against the legal limit of 67 milligrammes.
The incident happened at around 9.15pm when one of the pedestrians heard a noise from behind her and thought it was a cyclist approaching.
She turned around just as the car veered off the road, narrowly missing her.
The court was told Paton was a mother-of-four who had worked in public service for 30 years as a nurse.
She could give no explanation for her actions on the day in question. She has recently been working in a university teaching post.
Sheriff Charles Macnair told Paton it was only by luck she was not in the High Court facing a charge of causing death by dangerous driving.
He added: “The only thing that is keeping you out of prison is your lack of record and your lengthy period of good service to the community.”
He imposed a community payback order with 165 hours of unpaid work.
He also banned her from driving for two years. She will have to sit the extended driving test if she wants to get behind the wheel again.