A 44-year-old man, charged with invasion of privacy in connection with videos allegedly showing underage girls in the shower, pleaded guilty Thursday to a different set of charges and will avoid prison time as part of his plea deal.

Jay Ignacio Quinata in his agreement, pleaded guilty to two charges of unlawful distribution of images, one as a misdemeanor and one as a third-degree felony.

As part of his plea deal, the court accepted Quinata's guilty plea for the misdemeanor charge but deferred acceptance of his guilty plea for the felony charge. That means as long as he follows conditions of his supervised probation for three to five years without any violations, the court won’t accept the guilty plea for the felony charge and Quinata won’t be sentenced or convicted of that felony.

If he violates his probation, the court could then accept the guilty plea and Quinata could be sentenced to up to five years in prison, according to Judge Michael Bordallo. If he doesn’t violate his probation, the case against Quinata will be dismissed, but it won’t be expunged, Bordallo said.

For the misdemeanor charge, the court sentenced him to 89 days of time served, which means he won’t have to spend any more time in prison.

In the 14 months since he was allowed out on pre-trial release, three violations were filed against Quinata for failing to comply with his release conditions, according to court documents.

The first violation stated Quinata was at a lounge, even though he was ordered to stay away from establishments that serve alcohol.

He also violated his house arrest when he was at a middle school track and field competition, where a witness saw him taking photos, court documents state.

The third violation was filed in June this year when a witness reported seeing him at a Tumon restaurant, in violation of his house arrest, according to court documents.

Quinata was initially charged in July 2016 with invasion of privacy after his former roommate told police that Quinata had a USB flash drive that contained videos of two underage girls in the restroom, court documents state.

Based on police review of the video files, it appeared the camera that captured the girls showering was hidden underneath a sink in the bathroom, court documents state. In one video, Quinata is seen placing the camera under the sink, leaving the bathroom before an underage girl enters, undresses and showers, court papers state.

He reportedly admitted to someone else that he owned the flash drive, but denied ownership to police, the magistrate's complaint states.