An Arkansas man has confessed to intentionally contracting HIV with the purpose of exposing others to the virus.

According to the Northwest Arkansas Democrat-Gazette, Stephen Koch, 25, made the admission in court earlier this week. Koch has also pleaded guilty to child pornography and drug-related charges.

“Mr. Koch intentionally contracted the HIV virus so he could then infect others?” Circuit Judge Robin Green asked the prosecutor.

Koch answered that he had.

When asked whether the reason was to harm others, Koch also said yes.

Green sentenced Koch to 50 years in prison and ordered him to register as a sex offender.

Koch's plan was uncovered by police as they conducted an investigation into drug charges against Koch. Authorities discovered text messages and other communications related to the plan, according to the Northwest Arkansas Democrat-Gazette.

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