Alabama's governor signed into law legislation that requires some sexual offenders to be chemically castrated before being released on parole.

Gov. Kay Ivey signed the bill Monday, which applies to sex offenders convicted of crimes involving children under 13 and who are eligible for parole.

Chemical castration involves taking medication to reduce testosterone, hormones and other chemicals that drive libido, the bill says. The parolees are required to start the treatment a month before they leave prison and continue treatment until the court determines it is no longer necessary.