A 64-year-old Georgia man who worked with underage performers used his position to gain their trust and then secretly videotaped them in various states of undress in their hotel rooms, Suffolk prosecutors said.

William H. Allen, co-owner of Cirque de la Symphonie, captured nude and partially nude images of two performers under the age of 16 by hiding cameras in the smoke detectors in their rooms, Assistant District Attorney Nicole A. Poirier said in court records.

“He violated their trust, he violated their privacy and he violated the law,” District Attorney Daniel F. Conley said.

Allen of Athens, Ga., pleaded guilty last month to two counts each of secretly photographing sexual or intimate parts of a child and possession of child pornography.

Judge Mary Ames sentenced him yesterday to two years behind bars followed by 10 years of probation. During that time, he will be barred from living with or having unsupervised contact with anyone under 18 and from taking part in any job or volunteer work that would put him in contact with youngsters. Ames also ordered him to have no contact with his victims, to undergo a psychiatric evaluation and to complete any treatment deemed necessary, including sex offender treatment.

Prosecutors say Allen brought one of the victims to the Fairmont Copley Plaza in Boston on June 11, 2015, so the boy could perform with the Boston Pops at Symphony Hall. Prosecutors say the boy noticed images of his own hotel room on Allen’s laptop while discussing the performance schedule.

After the victim notified hotel security, prosecutors say authorities searched the room twice and found three wireless cameras hidden in smoke detectors in the bedroom and bathroom.

Boston cops later found videos on his phone and laptop that depicted the victim in various states of undress, prosecutors said. Investigators also found similar images of another underage performer at a different hotel, prosecutors said. That boy told police that Allen had raised the heat in the room and told him: “It’s warm in here. Do you always wear pajamas? We’re both men, you can wear your briefs.”