BANGOR — An Ellsworth man has been sentenced to six years in prison for secretly making video recordings of a young female relative in the bathroom.

Thomas King was also sentenced Tuesday in federal court to 10 years of probation and ordered to register as a sex offender upon release.

Prosecutors say the 43-year-old King hid a tiny camera inside a clock on the windowsill to make the recordings more than two years ago when the relative was under 12 years of age. The camera was discovered by the girl’s mother.

The judge said King was like a “second father” to the victim.

King was arrested in July 2011 and pleaded guilty in October to possession of child pornography.

King apologized in court for what he called “a horrible offense.”