On Tuesday, a federal judge blocked Alabama’s near-total abortion ban that would have taken effect next month. The ruling says that the law, one of several attempts at abortion restrictions by conservative states, is unconstitutional.

The bill, signed into law by Gov. Kay Ivey last May, would attempt to punish doctors who perform abortions with life in prison. The American Civil Liberties Union, ACLU of Alabama and Planned Parenthood Federation filed a lawsuit challenging the law on behalf of Alabama abortion providers.

US district judge Myron Thompson issued an expected preliminary injunction, which effectively blocks Alabama from enforcing the law that would have made abortion a felony in nearly all cases. Abortion providers had sued to block the law from taking effect on November 15.

“Alabama’s abortion ban contravenes clear Supreme Case Court precedent,” Thompson wrote. “It violates the right of an individual to privacy, to make choices central to personal dignity and autonomy. It diminishes the capacity of women to act in society and to make reproductive decisions. It defies the United States Constitution.”

With the arrival of new conservative justices on the Supreme Court, Alabama, along with several other red states, has tried to enact new restrictions on abortion in an attempt to challenge Roe v Wade, the 1973 decision that legalized abortion across the United States.

A number of states hoped to ban abortion once a fetal heartbeat is detected. In Alabama, conservative legislators wanted to ban almost all abortions with no exceptions for cases of rape and incest. The 2019 Alabama Human Life Protection Act would make performing an abortion at all stages of pregnancy a felony punishable by up to 99 years or life in prison for the abortion provider. The law only provided exceptions in cases where pregnancy posed a serious health risk to the mother or the fetus had a fatal condition that would result in death shortly after birth.

So far, none of the state bans have taken effect and several have already been blocked. The Alabama law was expected by both conservatives and progressives to be blocked by a federal judge since it challenges current Supreme Court precedent.

“As expected, the court has blocked the law and it will not go into effect,” said Randall Marshall, executive director of the American Civil Liberties Union of Alabama. “Abortion remains legal in Alabama. The state’s repeated attempts to push abortion out of reach by enacting unconstitutional laws restricting abortions have already cost taxpayers nearly 2 million dollars. This ill-advised law will cost taxpayers more money.”

Backers of the Alabama law, who were said to have anticipated Tuesday’s ruling, hope to eventually persuade the US Supreme Court to roll back abortion rights. In an earlier court filing, a state attorney wrote that a federal judge is “for now” bound by Supreme Court rulings that uphold abortion rights, but that Alabama hopes to eventually overturn those “tragically wrong decisions.”

RELATED: Pennsylvania Considers Banning Abortion As Early As Six Weeks Into Pregnancy

“Our law was designed to overturn Roe v Wade at the Supreme Court level, and today’s ruling is merely the first of many steps on that legal journey,” said Alabama Republican representative Terri Collins, who sponsored the ban. “I remain confident that our mission will be successful and appreciate the support of millions of citizens who support our effort to preserve unborn life.”