A U.S. airman stationed in Germany was sentenced by a court-martial Thursday to five years in jail for using hidden cameras in his off-base house to record women who were his guests bathing or undressing while he was away, according to a report.

Staff Sgt. Andrew P. Rogers told a general court-martial last week that he used cameras hidden in alarm clocks and smoke alarms to record the women in the bathroom or guest bedroom, Stars & Stripes reported.

The devices, which were connected to WiFi, were motion activated, allowing Rogers to watch the footage whether he was on base or on vacation, according to the outlet. Other footage was recorded directly on data cards which Rogers reportedly viewed on his laptop or phone.

A U.S. airman stationed in Germany was sentenced to prison Thursday after he pleaded guilty to indecent recording. (U.S. Army Corps of Engineers)

The illicit recordings took place between November 2015 and April 2018. A woman who’d been house-sitting for Rogers while he was on vacation discovered a hidden camera in the smoke detector while she was taking a shower, Stars & Stripes reported, adding that she later discovered a hidden camera in an alarm clock in the guest bedroom.

Air Force investigators confronted Rogers upon his return from vacation. Defense lawyers said Rogers admitted to secretly recording his guests and provided the names of other victims.

The women, who went unnamed in the report to protect their identities, testified in court that the experience traumatized them. One woman who worked with Rogers said she still checked for cameras, “even in my own house.”

CALIFORNIA MARINE FILMED VIOLENTLY TACKLING TWO BRAWLING STUDENTS TO THE GROUND

“I’ve searched my soul for answers,” Rogers told the court Thursday.

“I became obsessed with something unhealthy, something I knew was destructive, but I continued to do it.”

CLICK HERE FOR THE FOX NEWS APP

Rogers pleaded guilty to six counts of indecent recording, a violation of the Uniform Code of Military Justice.

In addition, he received a dishonorable discharge and demotion.