A military judge sentenced a sailor to 21 months of confinement after he pleaded guilty Thursday to charges that he recorded or attempted to record seven women without their knowledge while he was serving aboard the USS Theodore Roosevelt.

Under a presentencing agreement, Petty Officer 2nd Class Bryce Mezney will serve 12 months of that sentence. Cmdr. Heather Partridge also reduced his rank to seaman and gave him a dishonorable discharge.

Mezney, 22, had access to female berthing on the aircraft carrier during its 2015 deployment while the former Norfolk-based carrier was also in the process of completing a homeport switch to San Diego. While he had that access, Mezney attempted to record five junior officers and a civilian employee by holding up his phone to a grate in their stateroom doors. Mezney was caught after a seventh woman, an officer, spotted him using a phone to record her while she was changing.

That officer cried while she testified Thursday that the incident caused her to have temporary problems sleeping and left her feeling uneasy on the ship.

"I was forced to stay on the ship even though I didn't feel comfortable where I worked," she said. The Virginian-Pilot does not identify victims of sexual crimes.

Mezney joined the Navy in 2012. He cried as he apologized to his victims, his wife, mother and others in the courtroom.

"I was being very stupid to record someone who should feel safe," Mezney said.

This is at least the second time this year that an enlisted sailor based in Hampton Roads has been forced to answer to charges that he secretly recorded women serving aboard a vessel. In February, Petty Officer 3rd Class Ricardo Pilola pleaded guilty to filming seven co-workers, including his boss and at least two women he supervised, in a bathroom aboard a barge serving as a workstation for USS Enterprise sailors as the carrier undergoes deactivation in Newport News.

Mezney said he did not know any of the women involved in the case. His civilian attorney, Rick Morris, asked the judge to consider a six-month sentence, forfeiture of pay and allowances and a reduction in rank to seaman. Morris asked Partridge to consider his youthful age, a strong military career and upbringingin a small Colorado farming community. Mezney had already taken his wrongful actions "to heart," Morris said.

"Take it in context that this was not a physical assault, this was not a sexual assault," Morris said. "Yes, it is a violation of privacy."

Morris, a state delegate from Suffolk, faces charges that he assaulted a child and adult family member. He was arrested in September and has been released on bond.

Navy prosecutor Lt. Jeffrey Marden had argued that Mezney should face at least three years' confinementfor violating the trust the Navy placed upon him. Mezney worked as a hull maintenance technician and had been responding to trouble calls in female restrooms, called heads, when he admitted to the incidents. He said he did not share the videos but watched them in his workspace.

"He's the one who's supposed to be setting the example here," Marden said. "This wasn't some brand new seaman."