The 24-year-old had originally faced 132 charges involving more than 90 girls but a legal challenge over a Police Scotland search of his computers saw the number of allegations reduced to 34 charges.

Following the case, Detective Chief Inspector Martin Maclean of Edinburgh’s Public Protection Unit said: “Scoular is an extremely dangerous individual, taking every opportunity he could to go online and exploit young girls.”

And a leading charity urged any other victims who suffered at his hands to come forward and “speak up”.

A spokesperson for NSPCC Scotland said: “The threat posed to children by groomers like Scoular has increased in recent years and abuse is sadly still woefully underreported. For us to help children, we need people to speak up.”

Scoular denied his guilt but was convicted by a jury at the High Court in Edinburgh of 27 charges including rapes, grooming, sexual assault and underage sex.

The jury that convicted him heard Scoular’s sex crime spree went on until he was 18 and continued even after he was freed by a court on bail.

He used social media to make contact with potential victims and encouraged some to send him sexualised pictures and threatened to publish them online.

Lord Summers said Scoular used social media to make contact with girls and offered them affection and companionship at a time when some were vulnerable.

Despite his crimes, experts assessed Scoular as being at “medium risk” of re-offending and he dodged being slapped with an Order for Lifelong Restriction which could have seen him jailed for life.

Lord Summers told Scoular that he had originally opted to jail him for 18 years but reduced the sentence to 12 years because of his age at the time.

He also ordered that Scoular should be kept under supervision for a further five year period and placed him on the Sex Offenders’ Register indefinitely.

Advocate depute Steven Borthwick told the jury at Scoular’s trial last year that he had indulged in sexual conversations with them knowing they were under the age 16, the age of consent.

He asked girls to show him pictures of their naked bodies and in some cases to send them to him and went on to use such images to get them to do what he wanted.

The jury had not been told he was given a four and a half year sentence in 2014 at Edinburgh Sheriff Court after sending sexualised texts to young children.

Defence solicitor advocate Iain Paterson said a search of Scoular’s home took place in 2013 and mobile phones and computer equipment was seized.

The proceedings in the sheriff court were based on evidence from the phones. But the computer equipment was later looked at resulting in a second inquiry which led to the further charges in the High Court.

Mr Paterson said: “He has gone to the internet to engage with other people. Unfortunately he has engaged with other people in an entirely inappropriate manner.”

The solicitor advocate said: “He is a man who knows he has got to change. He wants to try to move on with his life.”

The court heard that Scoular used Facebook, Snapchat and Skype to befriend schoolgirls and would engage in online chatting, sometimes for weeks, to earn their trust before bringing pressure to bear.

Join our Facebook group Our Edinburgh to share images and news from and around the Capital

Trending

'Yer Da sells Avon': 21 uniquely Scottish insults and their history

This is being billed as the most expensive flat to rent in Edinburgh - take a look inside

Wester Hailes at 50: These 24 photos show the very early days of Edinburgh's Wester Hailes

Edinburgh roadworks: Scheduled road closures and diversions for Riding of the Marches and more

Fountainbridge building fire: Pictures show aftermath of 'explosion' which left chunks of stone metres from school