Alabama Gov. Kay Ivey on Monday signed a bill that forces sex offenders convicted of crimes involving pre-teens to be chemically castrated before their parole.

Under the measure, HB 379, certain offenders must receive medication that blocks testosterone production before they are paroled from prison. A judge would decide when the medication could be stopped.

According to the new law, offenders must pay for the treatment, and they can't be denied parole solely based on an inability to pay.

Republican Rep. Steve Hurst had proposed the measure for more than a decade.

“They have marked this child for life and the punishment should fit the crime,” Hurst told WIAT-TV in Birmingham.

ILLEGAL IMMIGRANT ARRESTED, ACCUSED OF MORE THAN 100 CHILD SEX CRIMES: REPORTS

Though authorized by several states, chemical castration remains highly controversial. Critics argue that forcing the procedure is a violation of human rights. It’s unclear how often the procedure is used throughout the U.S.

"This bill is a step toward protecting children in Alabama," Ivey said.

According to the law, if a given offender chooses to stop receiving the treatment, they will be in violation of parole and forced to return to custody.

GET THE FOX NEWS APP

Ivey’s press office said the bill will take effect later this year.

Fox News Louis Casiano and The Associated Press contributed to this report.