Officers became suspicious when Mirza named her attacker as a man from Perth, who was actually in jail at the time the alleged offences took place, which was when she was a pupil at Edinburgh Academy.

After searching her property, they found a journal where she documented her increasingly alarming thoughts and fantasies, including the names and offences of rapists and sexual offenders from around Scotland.

She later told detectives she concocted the attacks to explain her poor exam results after failing to get in to Strathclyde University, in Glasgow.

Mirza denied that on various occasions between May 15, 2012, and April 2, 2013, she falsely represented to police officers and civilian operators at the 999 service that she had been sexually assaulted and ra-ped in Edinburgh’s King George V park.

But a jury of 12 women and three men found her guilty after a nine-day trial earlier this month at Edinburgh Sheriff Court.

The first police officer to interview Mirza was DC Lesley Robertson of the Public Protection Unit on May 15.

She described how Mirza sat with her hair over her face as she talked to her and ran out of the room several times.

She said she found her behaviour quite strange. ‘I had concerns about her hiding her face and running out of the room’ she said. ‘I had the impression it was very well planned. I didn’t see any real distress or anything like that’.

DC Barry Murphy said Mirza told him she had been distressed and unhappy about her exams and had decided to ‘make up’ her alleged attack to explain her poor results.

She wrote a letter to one of the officer’s in the case which said: ‘Nothing happened. I went to the park and made it up. I wanted another year at school to get to Strathclyde University’.

Mirza told the jury she had wanted to do forensic biology at Strathclyde University and had had a conditional offer from them, but failed to get the ‘A’ in chemistry she needed

She said she wanted to do an extra year at school as she thought she had not done well in the exams. The court heard she did well in one exam however, getting 80 per cent for Drama.

Sentencing Mirza, Sheriff Michael O’Grady QC told her: ‘In many years in these courts in one capacity or another, I have come across the whole range of hateful, hideous and downright bizarre things that people do to each other and the world at large.

‘But I doubt, however, in all that time that I have encountered a course of conduct so strange, so needless and so hard to fathom as yours.’

He added: ‘It is also a course of conduct that is selfish, devious and persistent to a truly remarkable degree’.

He said resources were diverted from ‘genuine crimes where genuine victims were anxiously and fearfully waiting for their assailants to be brought to book’, adding: ‘That is not only appalling, it is positively cruel.’

‘For almost a year you spun a web of lies and deceit of quite remarkable scope, intricacy and forethought.

‘Throughout that time, you caused huge amounts of public money and effort, not to mention the dedication and commitment of the police officers from whom we heard, to be needlessly expended for no other purpose than the gratification of watching them dance to your tune’.