More than 500 potential victims of child abuse have been identified and 77 people have been charged following a major investigation into online sex abuse by Police Scotland.

The charges include rape, grooming of children for sexual purposes, and sharing indecent images, of which 30 million were found after 547 computers and other devices were seized.

The national investigation, called Operation Lattise, is the first of its kind to take place in Scotland and was carried out over five and a half weeks between 6 June and 15 July.

The operation involved 134 separate inquiries, and Police Scotland has said many of the investigations are still ongoing.

"Online child sexual abuse is a national threat," said Assistant Chief Constable Malcolm Graham in a statement.

"The reality is it is happening now, not only in Scotland but across the world, to children of all ages, from infants to teenagers."

Some of the 523 children identified as victims or potential victims of abuse were as young as three years old, and 122 of them have been referred to child protection services.

Paedophile Richard Huckle given 22 life sentences

“Operation Lattise was about shining a light on the scale of this issue," said Mr Graham.

"It was focused activity to tackle the many forms of online child sexual abuse by identifying those who pose a risk to children online and, more importantly, identifying victims of online sexual abuse and exploitation, as well as preventing more youngsters becoming victims."

The police were able to use covert technology to identify potential paedophiles using websites, chatrooms and forums to contact children, and track their location, said Detective Inspector Andy McWilliam.

“These men – and it is predominantly men – are using the profiles of younger children to groom them and offend against them,” he told the BBC.

“Whether they throw the computer in the bath or not, we can find what they have looked at."

As part of the investigation, officers analysed more than 100,000 online chat logs. They found one suspect had been communicating inappropriately with more than 110 children and young people.

In pictures: White Flowers Campaign to support child abuse victims Show all 10 1 /10 In pictures: White Flowers Campaign to support child abuse victims In pictures: White Flowers Campaign to support child abuse victims White Flowers Campaign A campaigner holds a banner at Old Palace Yard in Westminster, during an event organised by the White Flowers Campaign Group, in commemoration of victims and survivors of child abuse In pictures: White Flowers Campaign to support child abuse victims White Flowers Campaign Pictures, messages and floral tributes left at Old Palace Yard in Westminster, organised by the WhiteFlowers Campaign Group in commemoration of victims and survivors of child abuse In pictures: White Flowers Campaign to support child abuse victims White Flowers Campaign Jenny Tomlin, the mother of Martine McCutcheon, attends a gathering at Old Palace Yard in Westminster, organised by the White Flowers Campaign Group, to lay white flowers in commemoration of victims and survivors of child abuse In pictures: White Flowers Campaign to support child abuse victims White Flowers Campaign Child abuse campaigner Bill Maloney speaks to relatives, supporters, victims and survivors of abuse as they gather at Old Palace Yard in Westminster to lay white flowers in commemoration of victims and survivors of child abuse In pictures: White Flowers Campaign to support child abuse victims White Flowers Campaign Rotherham MP Sarah Champion speaks during a gathering at Old Palace Yard in Westminster, organised by the WhiteFlowers Campaign Group, to lay white flowers in commemoration of victims and survivors of child abuse In pictures: White Flowers Campaign to support child abuse victims White Flowers Campaign Simon Danczuk MP speaks during a gathering at Old Palace Yard in Westminster, organised by the WhiteFlowers Campaign Group, to lay white flowers in commemoration of victims and survivors of child abuse In pictures: White Flowers Campaign to support child abuse victims White Flowers Campaign John Mann MP attends a gathering at Old Palace Yard in Westminster, organised by the WhiteFlowers Campaign Group, to lay white flowers in commemoration of victims and survivors of child abuse In pictures: White Flowers Campaign to support child abuse victims White Flowers Campaign A woman leaves a floral tribute at Old Palace Yard in Westminster In pictures: White Flowers Campaign to support child abuse victims White Flowers Campaign Relatives, supporters and survivors of abuse hold a minutes silence during a gathering at Old Palace Yard in Westminster, organised by the WhiteFlowers Campaign Group, in commemoration of victims and survivors of child abuse In pictures: White Flowers Campaign to support child abuse victims White Flowers Campaign Jenny Tomlin, the mother of Martine McCutcheon (left) supports Esther Grace of Cardiff, a victim and survivor of abuse, during a gathering at Old Palace Yard in Westminster, organised by the WhiteFlowers Campaign Group, to lay white flowers in commemoration of victims and survivors of child abuse

The number of reported sexual offences involving children is growing, according to Police Scotland, who have released figures showing grooming children for sexual offences had more than doubled in the last year.

In 2015-16, the police force recorded 50 incidents of grooming, up from 23 in 2014-15.