THE judge who allowed a student who admitting raping a 12 year-old girl to walk free from court has “fundamentally misunderstood” the law, a leading psychologist has said.

Lady Scott took the “wholly exceptional” decision to grant 21-year-old Daniel Cieslak an absolute discharge at the High Court in Glasgow and instead gave the first offender an absolute discharge at the High Court in Glasgow.

Mr Cieslak had believed the girl, who he met in a taxi queue in Edinburgh in July 2015, was 16. Rape laws, which were strengthened in 2009, do not allow any child under the age of 13 to give informed consent about sexual intercourse, which should mean there is no defence of consent.

READ MORE: Maths teachers left 'demoralised' by National qualifications changes that make it harder for pupils to pass

Lady Scott said there were exceptional circumstances in the case, including the accused and other witnesses believing the girl was 16 or older, that the child was an “active participant” in sexual activity and that there was no suggestion of “predatory conduct” or grooming.

But a leading expert in gender-based violence said the girl’s age was the inescapable fact in the case.

Dr Mairead Tagg said: “You cannot on one hand say that 12-year-olds need to be protected because they cannot give consent then base a judgement on the victim’s complicity. She was 12-years-old.

“The body of a young girl reaching adolescence responded to the sexual overtures of an adult. We find this often with sex abuse victims.”

The clinical psychologist added: “This is an indictment of our sexualised society. Why do we have 12-year-olds who are so clearly sexualised?”

Lady Scott said she had decided “justice is best served” by taking the “wholly exceptional decision” to give Mr Cieslak an absolute discharge, telling the court the statutory rape offence had a “very wide scope” with, as a result, a “variation” in sentencing.

The judge went on: “The fact the Lord Advocate decided it was in the public interest in bringing this prosecution does not limit my discretion in deciding the appropriate disposal.”

She said the purpose of the offence was to “protect young girls” but added there were “exceptional circumstances” in this case.

The judge concluded: “I am satisfied you have been subject to considerable pressure and distress from the burden of this prosecution.

“I do not consider there is any need, or public interest, in punishment. To do so would, in my view, be disproportionate given the nature of the criminal culpability here.”

A hearing was last month told how the victim and a teenage friend had been in Edinburgh city centre on July 31 2015. In the early hours of the next morning, police were in Princes Street following a report of a missing girl.

The 12 year-old happened to direct officers to the child they were looking for.

Despite the time, prosecutor Kath Harper explained: “Police spoke to (the girl who was raped), but did not note her details as they were not concerned by her age.”

The court heard that about 04:00, the girl and her friend met Mr Cieslak and one of his friends in a taxi queue. The victim said she was 16 and her friend was 17. The taxi driver later said he thought the girl was 20.

Mr Cieslak then invited them to a party at his friend’s house, where he had sex with the 12-year-old.

READ MORE: Maths teachers left 'demoralised' by National qualifications changes that make it harder for pupils to pass

The court heard she left the next morning, and there had been no suggestion of her being distressed.

The offence came to light days later after the girl told her sister she was “extremely worried” she could be pregnant.

Prosecutor Miss Harper said: “When it became clear police were suggesting she was younger, he asked them what age she was.

“When told she was 12 years-old, he started to cry.”