A teenager sparked a major police inquiry after falsely claiming a friend had raped her.
Perth Sheriff Court heard Sinead Robertson, 16, told officers she had been sexually assaulted following an argument with her male friend.
She pointed out where the alleged attack had happened and the area was "cordoned" off to preserve evidence.
On Thursday, Robertson admitted wasting police time by making a false rape allegation in Perth on 17 December.
The court heard Robertson's tale began to unravel when detectives studied CCTV footage of the area where she claimed she had been raped.
'Serious allegation'
After studying several hours of footage, the officers realised that the teenager had not even been in the area during the time she claimed.
Fiscal depute Stuart Richardson said police had been called to where Robertson, of Perth, had been staying and she told officers she had been attacked and raped by a man.
"On the way to police HQ she pointed out to officers the locus of the attack.
"The first thing done was that it was cordoned off and officers were detailed to remain and preserve the scene because of the serious nature of the allegation."
He added that several hours of CCTV footage was viewed by an officer and it showed Robertson had not been in the area.
"A book of photos was shown and she pointed out one individual and said it could have been the person responsible," Mr Richardson said.
However the court heard that when it was put to Robertson that she was not telling the truth, she admitted the story was invented and that she had had an argument with a male friend which had led her to make the story up.
Sheriff Michael Fletcher warned Robertson the matter was "serious" and deferred sentence for social background reports, community service and restriction of liberty reports.