(CNN) Republican Alabama Gov. Kay Ivey on Monday signed a bill into law that requires someone convicted of a sex offense against a child under the age of 13 to begin chemical castration a month before being released from custody.

The law requires individuals convicted of such an offense to continue treatments until a court deems the treatment is no longer necessary. It says offenders must pay for the treatment, and they can't be denied parole solely based on an inability to pay.

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

Both houses of the Alabama Legislature approved the legislation late last month, after it was put forward by state GOP Rep. Steve Hurst.

Chemical castration involves administering medication -- via tablets or injection -- to take away sexual interest and make it impossible for a person to perform sexual acts. If the person stops taking the drug the effects can be reversed.

Read More