Two Fox Lake residents charged in a drug and child pornography case agreed to plea deals Wednesday in Lake County court.

Joshua S. Hoffman, 24, pleaded guilty to one felony count of possession of child pornography. His roommate, Mariah Carlos, 19, pleaded guilty to a misdemeanor count of unlawful possession of a controlled substance.

Defense attorney Greg Nikitas said Hoffman will serve 24 months of probation, is required to attend sex offender counseling and must register as a sex offender for the rest of his life. Hoffman did not receive additional jail time because he has served 314 days in Lake County jail since his arrest Feb. 3, Nikitas said.

Hoffman was initially charged with reproducing child pornography, possession of child pornography, aggravated unlawful use of a weapon and felony drug charges for possession of cannabis, LSD, Psilocybin mushrooms and MDMA, authorities said. The remaining charges were dropped as part of the plea deal, Nikitas said.

Carlos, who was sentenced to 18 months’ supervision, was initially charged with unlawful possession of cannabis with intent to distribute, unlawful possession of more than 1,000 grams of cannabis, and unlawful possession of drug paraphernalia. The remaining charges against her were dropped as part of the plea deal, Nikitas said.

They were arrested after an investigation by the Lake County sheriff’s Cybercrime Unit and the Lake County state’s attorney’s office led to a search warrant for a residence they shared on the 100 block of Riverview Avenue, authorities said.

Detectives discovered a loaded firearm, a significant amount of drugs and multiple devices capable of storing digital media, authorities said. A forensic examination of the devices revealed hundreds of videos identified as child pornography, authorities said.

Hoffman reproduced at least one pornographic video in which the children depicted were younger than 13, authorities said.