An Arkansas man said he intentionally contracted HIV in an attempt to expose others to the virus.

Stephen Koch, of Scranton, Arkansas, admitted in court earlier this week that he intentionally contracted the virus and intended to go on a date and lie about his status, according to the Northwest Arkansas Democrat-Gazette. The 25-year-old also pleaded guilty to child pornography and drug-related charges.

The Democrat-Gazette reported that Benton County Chief Deputy Prosecutor Stuart Cearley told the court that Koch’s admissions were uncovered during a police investigation.

“Just so I can get my brain around this, did I understand the state correctly?” Circuit Judge Robin Green asked the prosecutor, according to the newspaper. “Mr. Koch intentionally contracted the HIV virus so he could then infect others?”

Koch said it was true.

The judge then told him that such a plan would harm others, asking him: “Was that the reason?”

Again, Koch said yes.

Koch pleaded guilty to numerous drug charges; eight counts of distributing, possessing or viewing matter depicting sexually explicit conduct involving a child; and attempting to expose another person to HIV, according to court records.

He was sentenced to 50 years in prison as well as ordered to register as a sex offender and go through a offender treatment program in prison, according to the Northwest Arkansas Democrat-Gazette.

An attorney could not immediately be reached for comment; it is unclear who is representing Koch.

Koch was initially charged with drug crimes, including possession of methamphetamine with purpose to deliver, delivery of meth and possession of drug paraphernalia, according to court records.

During the investigation, authorities learned that Koch had been watching child pornography. While searching Koch’s computer for evidence, authorities discovered text messages and other communications about his HIV status and his intentions to spread the virus, according to the Northwest Arkansas Democrat-Gazette.

HIV, or human immunodeficiency virus, destroys cells needed to fight disease and, when not properly treated, can lead to AIDS. It is spread through bodily fluids, such as blood and semen, and although there is no cure, it can be managed with treatment, according to the Centers for Disease Control and Prevention.

Benton County Sheriff Shawn Holloway said in a statement Wednesday that authorities “worked swiftly in building their case, apprehending the suspect and preventing any further criminal activity.”

“This case provides an excellent opportunity for parents in our community to engage their children and speak on the dangers associated with unprotected sexual activity, meeting people online and sexual activity with partners that are not well known,” the sheriff said. “The dangers from sexual activity are high enough without predators such as Stephen Koch, purposely and with intent, spreading Sexually Transmitted Diseases to partners without their knowledge.”