A child rapist photographed his abuse of a two-year-old girl in Moray and shared the images, a court has heard.
Matthew Sinclair, 28, from Elgin, was caught after he left his mobile phone on to charge and a woman looked at its contents and found messages on an app.
Sinclair admitted raping the two-year-old and distributing or showing indecent photos.
A judge said Sinclair had committed "acts of breathtaking wickedness and depravity".
Advocate depute Alex Prentice QC told the High Court in Edinburgh: "The accused raped the child when she was two years old. The accused took indecent photographs of her and distributed these to an unknown person."
Defence counsel Susan Duff said that when she consulted with Sinclair he told her he wanted to plead guilty.
Judge Michael O'Grady QC said: "Only a very significant sentence in custody can begin to reflect the gravity of these crimes."
He deferred sentence on the first offender for the preparation of a background report and risk assessment and remanded him in prison.
Sinclair was put on the sex offenders' register and was referred to Scottish ministers in terms of protection of vulnerable groups' legislation.