A depraved paedophile set up secret cameras to film children and a woman in sexual scenes.
Keith Ferguson preyed on his victims over a five-year period.
But he was snared after police received information from the National Online Child Abuse Prevention Agency and searched his home in Aberdeen.
At the High Court in Edinburgh yesterday the 44-year-old admitted a string of charges.
They included downloading and possessing indecent photographs and photographing a primary school age girl undressing.
He also admitted sexually assaulting young girls including raping one while she was asleep and engaging in sexual activity in the presence of two youngsters.
He also admitted sexually assaulting a woman while she was asleep.
The offences covered a period from June 3, 2010, to June 3 this year.
Advocate depute, Stephen McCloy, prosecuting told judge Lord Malcolm that police found 1,552 downloaded indecent photographs, with 78 at the most serious level.
There were 233 indecent videos, with 103 at the top level.
The images were mainly of girls aged between two and 14.
The search also uncovered the mobile phone and hidden camera pictures of his victims, taken mostly when they were sleeping.
Mr McCloy said that when Ferguson was interviewed by police about the downloaded images, he told them he had been searching for “normal films” and images of naked children had “come up” which he ended up keeping.
The pictures taken by him on his mobile phone showed him moving or removing the clothing of the sleeping children and molesting them.
Lord Malcolm told Ferguson he would defer sentence for background reports and a risk assessment.
He also placed him on the sex offenders register.
Ferguson, described as a prisoner at HMP Grampian, will return to court for sentence on October 28.