A school cleaner filmed himself sexually abusing a baby, a court heard on Wednesday.
The footage was found after police seized computer equipment at James Reekie's home in Glenrothes, Fife.
They discovered that he had been using him mother's laptop computer to download images of child abuse after his own computer was broken.
Experts also detected a home-made video clip lasting for one minute and four seconds which appeared to have been created on a mobile phone.
A search then began to trace the child filmed sitting on a bathroom floor and wearing denim dungarees.
The High Court in Edinburgh heard that once the family of little girl had been traced and informed, the 11-month-old baby was taken to hospital but found to be uninjured.
Reekie, 28, of Alexander Road, Glenrothes, pleaded guilty to downloading indecent photos or pseudo photos of children and possessing the indecent material between July last year and June.
He also admitted sexually assaulting the 11-month-old by trying to make the toddler perform a sex act.
Judge Lord Pentland said it was "an aggravation of the utmost gravity that the abuse was filmed" and ordered an in-depth investigation which could see Reekie handed a life sentence.
The judge also expressed concern about Reekie's job at Auchmuty High School in Glenrothes, before he was taken into custody.
Solicitor advocate Chris Fyffe, defending, said Reekie's part-time job there was outside school hours but he could not guarantee there was no overlap between pupils leaving and Reekie arriving.
The lawyer added that Reekie, who suffers from muscular dystrophy, was extremely remorseful about what he had done.
Advocate depute Richard Goddard, prosecuting, told how police were tipped off that an internet user at Reekie's address had accessed an indecent video of a child.
Initially some suspicion fell on Reekie's father because the internet service was in his name but it was quickly ascertained that he had little or no computer skills.
The officers seized a laptop computer from the dining room table and a mobile phone and computer tower from Reekie's bedroom.
Reekie denied all knowledge of indecent material and claimed someone had sent him a computer virus.
"As the interview progressed he admitted he liked girls dressed as schoolgirls and described himself as 'sick'," said Mr Goddard.
After two hours in a cell, Reekie "flippantly" admitted responsibility for everything on the computers but soon afterwards began to cry.
The court heard that the laptop was found to have 178 indecent photos and seven indecent videos, most of them featuring youngsters in erotic poses but some showing sexual activity.
The computer tower had 215 photos and 138 videos showing a variety of indecency involving children.
Reekie was remanded in custody and is due back in court, in Glasgow, in December.
People who read this story also read
- Hibs striker banned from road after driving through red light
- Paedophile used 'emotional blackmail' to groom and rape children
- Gangland feud victim run over by car could be in line for £8m pay out
- Carer branded 'despicable' after stealing money from 84-year-old woman
- Grangemouth owners shut oil refinery until next week amid dispute