A Perth father has admitted sexually abusing young girls while they were on sleepovers at his northern suburbs home, where police also found up to two million images and videos of child pornography.

Key points: The man abused two relatives and two of his daughter's friends as they slept

The man abused two relatives and two of his daughter's friends as they slept He took photos and videos of the abuse and was "persistent" in seeking sleepovers

He took photos and videos of the abuse and was "persistent" in seeking sleepovers The volume of child porn material he had was unheard of in WA, the court was told

The man, who cannot be identified, pleaded guilty to almost 40 offences including sexual penetration of a child, indecently recording a child and possession of child exploitation material.

The District Court was told two of the victims were his relatives and the other two were his young daughter's friends, with all four girls aged between five and eight.

The court heard the 45-year-old took photos and videos of himself carrying out the abuse, which he then saved onto electronic devices.

Prosecutor James Nicholls said the man would target the girls when they were asleep and then abuse them sometimes for as long as three hours.

One of the victims later told investigators that she had pretended to be asleep throughout the ordeal because she was "so scared she did not want him to know she was awake".

The man also admitted taking indecent photos and videos of three other young girls aged eight and nine while they were on playdates with his daughter, but the court was told he did not physically touch them.

Some of the parents of the girls later reported that the man had been "quite persistent" in arranging the sleepovers and playdates, which Mr Nicholls said could suggest he was creating opportunities for him to abuse the victims.

'Unprecedented' collection of child porn

The court was told the offences came to light after two of the girls told their mother what had happened, resulting in police searching the man's home.

The man will be sentenced in court next week.

Mr Nicholls said analysis of his electronic devices found up to 2 million "well catalogued" videos and images of child exploitation material, a figure the prosecutor described as "unprecedented" in WA.

The man was also found to have traded child pornography images on an internet chat site.

Defence lawyer David McKenzie said his client was deeply remorseful and apologetic for the effect his crimes had on the victims.

The man, who has been in custody since his arrest in April 2016, will be sentenced next week.