A 13-year-old girl discovered her neighbour was using a hidden camcorder to video her in the nude when she was having a shower after staying-over in his home.
She had noticed the red light flashing on the camera while she dressed and rewound the film to discover the man standing in front of it when setting it up.
She ejected the tape and took it home in her pocket to show it to her mother, Dublin Circuit Criminal Court heard.
John Dooley (46), Donegal Road, Ballybofey, Co Donegal, pleaded guilty to knowingly producing child pornography at his home on January 3rd, 2002.
Judge Desmond Hogan placed his name on the Sex Offenders Register and remanded him on continuing bail for sentence on February 24th, 2004, so that he can be interviewed in great detail by the Probation and Welfare Services.
Garda Gary Walsh told Ms Pauline Walley BL, prosecuting, that minutes after the now 15-year-old girl returned home with the tape, Dooley phoned and asked her if she had it. He said his son had been playing around with it and could have left it in the spare room but the girl told him she didn't have it.
Garda Walsh said Dooley, who lives with his partner and 4-year-old son, was arrested after the girl made a statement to gardaí.
Gardaí searched his home and seized the camcorder. They also checked his computer where they found evidence of adult pornography, but none involving children. He said he didn't know why he did it because he wasn't into that sort of thing and he apologised.
The girl made a second statement to gardaí later and said a number of months prior to this offence, Dooley had shown her pictures on his computer of a man and a woman naked. He told her not to tell her mother because she would kill him.
Garda Walsh said that the two families had known each other for years and the girl had stayed in his house many times since she was a baby.
Mr Erwan Mill Arden SC, with Ms Tessa Feaney BL, for Dooley, said his client had pleaded guilty at the earliest opportunity and cooperated with the gardaí from the outset.
He could not be more contrite and troubled about the offence if he had killed the girl and was anxious to make apologies.