Alice Thomson slashed her own face and planted knife on her ex in a bid to set him up over attempted rape claim.
A charity worker slashed her own face and then planted the knife in a bid to frame her ex-boyfriend over a false rape bid claim.
Alice Thomson told police Ian Carmichael had attacked and tried to rape her and he was promptly lifted by officers and held for questioning.
But in truth Mr Carmichael had been forced to flee from Thomson's home bare-chested after she ripped off his shirt during a drunken late night argument.
Mr Carmichael had run off in terror to his grandmother's house and was shocked when officers arrived to tell him he had been accused of trying to rape Thomson.
Thomson was allowed to walk free from court after Sheriff Michael Fletcher told her that she had avoided a custodial sentence "by a whisker".
Fiscal depute Julie McAra told Perth Sheriff Court that Thomson and Mr Carmichael had been in the town's Mallard Bar with friends on the day in question. One of the women in the group had become so drunk she had to be taken home, and it was Thomson and Mr Carmichael who assisted her.
The depute fiscal said: "Mr Carmichael and the accused have been in an on-off relationship. At 1.30am there was a scuffle between Mr Carmichael and the accused.
"The accused ripped Mr Carmichael's shirt off. Mr Carmichael eventually managed to break free from her and he ran bare-chested to his grandmother's house.
"At 3.32 am a telephone call was received at police HQ in Perth from the accused, who claimed to have been slashed twice by a knife by a male who attempted to rape her."
When police arrived at Thomson's home, she appeared to have several small cuts to her cheek and she told officers that Mr Carmichael had repeatedly slashed her with a knife.
She added: "She said he had subsequently thrown the knife away in the front garden. The officers went to the front garden and recovered a knife. She told them it was the same knife she had been assaulted with."
The officers also found Mr Carmichael's shirt, but Thomson was unable to explain to them how it had ended up there. She then denied anyone had tried to rape her.
However, she insisted Mr Carmichael had attacked her with a knife and he was brought in for questioning. He denied any knowledge of the knife and alleged it was he who had been attacked.
He was arrested for assault and was only let go when the police surgeon studied Thomson's wounds and decided they were almost certainly self-inflicted.
Thomson, 22, of West Mill Street, Perth, admitted falsely representing to police officers that she had been subjected to assault and attempted rape in Perth on 25 October last year.
Solicitor David Holmes, defending, said Thomson had been doing charitable works for several years and was an "independent spirit, a positive spirit."
Sheriff Fletcher sentenced Thomson to 200 hours community service, and said: "Allegations of this kind are treated very seriously indeed by the court. It puts the police to a great deal of trouble and the person against whom the allegation is made is subjected to a very embarrassing investigation.
"Somebody was taken into custody as a result of this. My first thought about this was a custodial sentence. I take into account that it seems to have fallen through quickly and I will deal with it by a community service order, but you missed custody by a whisker."