A tired driver dozed off when waiting for a train to pass through a level crossing.

The sleepy episode could end in a jail sentence for Barry Miller, as he was banned from driving at the time.

Miller, 40, of Leadside Crescent, Wellwood, appeared in the dock at Dunfermline Sheriff Court.

He admitted that on 19th June on Kingseat Road, Dunfermline, he drove a car while disqualified and without insurance.

Depute fiscal Azrah Yousaf said at 10.50pm police received a call about a vehicle stopped in the middle of a road with the driver and his passenger unresponsive.

When officers arrived and woke him up, Miller said he had been “waiting for a train to pass through the crossing and had fallen asleep”.

When checks were made these disclosed that Miller was banned.

Defence solicitor Alexander Flett said: “He was breathalysed and there were no concerns about his fitness to drive.

“He was suffering from a lack of sleep. It was his passenger’s car and he had driven her from Kinross ironically because he was concerned that she was too tired to drive.”

The court heard Miller has analogous convictions.

Sheriff Krista Johnston told him: “You can be in no doubt about the difficulties you’re in, given your record. Clearly a custodial sentence is uppermost in the mind of the court.”

She called for reports and imposed a temporary ban until sentencing on 21st August.