A convicted sex offender has been jailed for secretly placing spy cameras in the female toilets of the studio where the new James Bond movie is being made.

Peter Hartley, 50, was given a 16-month sentence on Friday for using miniature motion- and vibration-sensing cameras to spy on women who were using the bathroom at Pinewood Studios, which is west of London. Hartley, who worked in maintenance, installed the cameras behind a grill in one of the women's lavatories, and prosecutors say he taped over the camera's LED light so it wouldn't be detected.

He was originally charged with voyeurism after a freelancer working on the new Bond film, "No Time to Die," reportedly saw a beam of light reflecting off the hidden camera's lens. The woman subsequently removed the grill with a screwdriver and uncovered the camera, according to the Guardian.

MAN ARRESTED ON 'BOND 25' FILM STUDIO FOR HIDING A CAMERA IN A WOMEN'S BATHROOM: REPORT

When asked why he planted the device in the studio toilets, he told police, “I suppose sexual gratification is the main reason, as I’ve learned from my past whenever something bad or stressful happens I act out.”

Peter Hartley, 50, arrives at Aylesbury Crown Court, Friday, September 6, 2019 where he was jailed for 16 months after planting a spy camera in the ladies' toilets of Pinewood Studios, where the latest James Bond is being filmed. Andrew Matthews/PA Wire/ Press Association via AP Images

Hartley completed a sex offender rehab program just eight months before his act was discovered in June. He was jailed at Aylesbury Crown Court on Friday for 16 months and placed on a sex offender register for 10 years.

“I don’t believe he has any remorse," said the victim. "This was a deliberate act, using high-definition, wide-angle and vibration-triggered equipment. He knew exactly what he was doing and must have seen the damage [to previous victims] last time.”

'BOND 25' TITLE AND RELEASE DATE FINALLY REVEALED IN NEW TEASER

Hartley had a history of similar voyeuristic offenses dating back to 2008. He was convicted of placing cameras in a council building in 2009 and in a changing room in 2016. In total, he has three convictions for eight offenses.

The victim who discovered his voyeurism at Pinewood Studios said she's experienced anxiety and needed mental health treatment. Judge Francis Sheridan said the woman has been "devastated" by Hartley.

CLICK HERE TO GET THE FOX NEWS APP

“I am not eating or sleeping properly, and I don’t feel safe anywhere," the woman said. "I check the whole house for cameras. I don’t doubt that I will check every bathroom I go into for the rest of my life."