Alabama lawmakers have sent a bill to the governor that would require some convicted sex offenders to be chemically castrated before being released on parole.

The bill, passed in the state Senate late last week and sent to Gov. Kay Ivey, would also require sex offenders convicted of crimes involving children under 13 and eligible for parole to pay for the chemical castration.

Chemical castration involves taking medication to reduce testosterone, hormones and other chemicals that drive libido, the bill states. The parolees would be required to continue the treatment until the court determines it no longer necessary.

Only certain people convicted of sex offenses involving children are eligible for parole in Alabama.

"This bill would provide that a person convicted of a sex offense involving a person under the age of 13 years who is eligible for parole, as a condition of parole, shall be required to undergo chemical castration treatment in addition to any other penalty or condition prescribed by law," the bill states.

Abortion law:How the Alabama abortion law is roiling Democratic and Republican politics

State Rep. Steve Hurst first introduced the bill in the House.

"I had people call me in the past when I introduced it and said, 'Don't you think this is inhumane?' I asked them what's more inhumane than when you take a little infant child, and you sexually molest that infant child when the child cannot defend themselves or get away, and they have to go through all the things they have to go through. If you want to talk about inhumane – that's inhumane," Hurst told WIAT-TV in Birmingham.

Under the bill, if a person cannot afford the treatment, the fees would be waived. The bill also says that anyone who stops receiving treatment without the court's approval would be taken back into custody.

Attorney Raymond Johnson told WIAT-TV that there would likely be a challenge under the Eighth Amendment, claiming "that it is cruel and unusual punishment for someone who has served their time and for the rest of their life have to be castrated."

Follow USA TODAY's Ryan Miller on Twitter @RyanW_Miller