A student who admitted raping a 12-year-old has been allowed to walk free after a judge said it was "reasonable" to assume she was over 16.
Daniel Cieslak, 21, had sex with the child after meeting her in a taxi queue but did not realise she was under 16 and burst into tears when he was arrested and police revealed her real age.
He had pleaded guilty to rape at an earlier hearing as she was under the age of 13 and therefore legally incapable of consenting.
After hearing the facts of the case, Lady Scott told the High Court in Glasgow that "justice is best served" by taking the "wholly exceptional decision" to give Cieslak an absolute discharge - the most lenient sentence possible.
She said: "I do not consider there is any need for, or public interest in, punishment. To do so would in my view be disproportionate given the nature of the criminal culpability here."
Lady Scott, who represented Abdelbaset Ali Mohmed al-Megrahi in his Lockerbie bombing appeal before being made a judge in 2012, has attracted controversy in the past over her judgement in rape cases.
In 2012 she was criticised by MPs for telling Algerian refugee Hamadache Hamza, who subjected a woman to a weekend-long rape ordeal, that he deserved "credit" for overcoming his “very difficult background" and setting up a successful hairdressing busines
The court heard that in July 2015 Cieslak, then 19, met the girl and her 13-year-old friend in a taxi queue in Edinburgh in the early hours of the morning and - after being told they were 16 and 17 - they invited them back to a party.
The police had spoken to the teenager earlier in the evening whilst searching for another girl, but they had not even noted her details as there were no concerns about her age.
Their taxi driver later said that he thought the girl was 20.
For what it is worth my impression from viewing the victim on the CCTV footage on assessment by appearance that the victim was over 16 years of age would be a reasonable one
Cieslak and the 12-year-old had sex and she left in the morning on good terms.
However, she later told her sister she was worried she was pregnant and her sister reported it to the police.
Lady Scott , noting a number of "exceptional circumstances", said that had girl, who was 12 years and seven months old at the time of the offence, been 13 Cieslak would have been able to argue that he believed she was old enough in his defence.
After watching the CCTV and hearing from the witnesses including the police who shared Cieslak's views on her age Lady Scott said it would have been "reasonable" for him to believe she was over 16.
She said that it was a statutory offence to protect young girls but there was a "very wide scope" and there was no suggestion of any "predatory conduct" in this case. Cieslak will not be put on the sex offenders register.