A woman walked into a police station and lied that a taxi driver had tried to rape her after he threw her out for being drunk.
Fiona Scanlan, 40, claimed she was attacked by William Millar shortly after she drunkenly left a wedding in South Lanarkshire in March 2014.
Mr Millar, 56, had picked her up from a hotel before stopping the journey after she hurled abuse at him.
Scanlan then reported at a police station that Mr Millar had taken her to a quiet area and tried to rape her.
The allegations led to the innocent driver being held by police for 18 hours and having to take part in intimate examinations.
Scanlan's lies unravelled when the GPS system in his car showed he had made no stop-offs while Scanlan was in the vehicle.
It led to Mr Millar being freed and Scanlan instead facing charges.
Scanlan wept in court on Wednesday as a sheriff told her she is facing jail after admitting making the false allegations.
She had been at a wedding at the Crutherland House Hotel in East Kilbride where she was described as "very drunk". She later asked for a taxi home and it was Mr Millar who arrived.
He collected her despite initially refusing to and soon into the journey Scanlan started hurling verbal abuse at the driver.
Glasgow Sheriff Court heard she said: "I am a nurse... you are nothing but a psycho."
The fed-up taxi-driver eventually decided he wanted Scanlan out of his car.
She turned up at Cathcart police office and claimed she had been the victim of a sex attack in Mr Millar's car. She described a detailed assault after the driver had apparently pulled over into "a secluded area".
Scanlan said Mr Millar tried to have sex with her before bizarrely dropping her off at the police station.
Officers were wary of "inconsistencies" in her claims but the driver was still held that morning and kept in police custody for 18 hours as he was quizzed about the accusations.
Mr Millar was also made to go through a number of medical examinations. The GPS tracker in his car was then checked as part of the investigation.
It showed that Scanlan's claim that he had gone to a quiet area before attacking her was wrong.
Prosecutor Zahra Latif said: "The taxi did not make any lengthy stops during the journey."
Mr Millar was released without any charge. Scanlan was detained by police in October 2014 after she was found to be lying.
The court heard Mr Miller described what happened to him as "one of the most embarrassing things in my life". He is still a taxi driver but suffers from "worry and stress".
Mr Millar later begged his bosses to get a camera fitted in his vehicle to avoid similar false allegations being made in the future.
In a police statement, he concluded: "I feel that it is important that its known publicly that my name is cleared.
"I feel there is a stigma attached to me and I want everyone to know that I did not do this."
Scanlan, of Rutherglen, South Lanarkshire, was freed on bail pending sentencing next month.
Sheriff John McCormick told her: "This was an appalling allegation while under the influence against someone endeavouring to take you home, and proceeded upon when sober.
"It is very likely a custodial sentence will be imposed."