Alabama state lawmakers passed a bill that would require child predators to be “chemically castrated” before they leave prison, a report said Tuesday.

The bill, which was submitted to Gov. Kay Ivey over the weekend, will require sex offenders convicted of abusing a child under the age of 13 to take drugs that block the production of testosterone and hormones as a condition of parole.

If a convict refuses to take the medication, they’ll be considered in violation of parole and immediately taken back into custody, the bill states. They’ll also be required to pay for the medication.

The treatment will begin a month before a sex offender is released from prison and will continue until a judge decides it’s no longer necessary, the bill states.

State Rep. Allen Treadaway told a local Fox affiliate that he backed the bill to “ensure public safety.

“Any action that we can take against a child molester that would prevent them from ever committing this type of crime again, I support, including chemical castration,” he told the news station.

“I think this bill is one of those steps to ensure public safety,” he added.