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.
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.
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.