MONTGOMERY, AL - MAY 15: The Alabama State Capitol stands on May 15, 2019 in Montgomery, Alabama. Today Alabama Gov. Kay Ivey signed a near-total ban on abortion into state law. (Photo by Julie Bennett/Getty Images)
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.

Several states have versions of chemical castration in their laws.

The legislation defines chemical castration as “the receiving of medication, including, but not limited to, medroxyprogesterone acetate treatment or its chemical equivalent, that, among other things, reduces, inhibits, or blocks the production of testosterone, hormones, or other chemicals in a person’s body.”

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.

The use of chemical castration is internationally controversial, and critics say forced chemical castration violates human rights.

“It certainly presents serious issues about involuntary medical treatment, informed consent, the right to privacy, and cruel and unusual punishment. And, it is a return, if you will, to the dark ages,” Randall Marshall, the executive director of the Alabama chapter of the American Civil Liberties Union, told CNN in a statement Tuesday.

“This kind of punishment for crimes is something that has been around throughout history, but as we’ve gotten more enlightened in criminal justice we’ve gotten away from this kind of retribution,” Marshall said, adding that there likely won’t be a legal challenge to the law until it is “actually implemented and ordered by a judge.”

Caitlin Donovan, a spokesperson for the National Patient Advocate Foundation, also criticized the legislation, telling CNN in a statement Tuesday that “Medical decisions should remain between a patient and their provider.”

“I worry about any precedent that allows the state to use health care as a form of punishment,” Donovan said.

This story has been updated.

CNN’s Eli Watkins and Devan Cole contributed to this report.