A federal judge on Tuesday ruled that an Alabama abortion law considered the strictest in the country will not go into effect, citing Supreme Court precedents that forbid bans on abortion prior to fetal viability.

Supporters of the Alabama law hope to use it to spur the Supreme Court to revisit those reproductive rights precedents, including the landmark decision Roe v. Wade. They expected lower courts to block the law.

The law criminalizes providing an abortion at any stage during a pregnancy, threatening doctors with prison sentences up to 99 years. It was set to take effect Nov. 15. The law provides no exception for rape or incest victims, but allows the procedure in cases where the patient's life is at risk.

"Enforcement of the ban would yield serious and irreparable harm, violating the right to privacy and preventing women from obtaining abortions in Alabama," District Judge Myron Thompson wrote. Thompson issued a temporary injunction that will prevent the law from going into effect until the court resolves the case in full.

Gov. Kay Ivey signed the law in May, acknowledging at the time that it was illegal under federal law and likely unenforceable.

The law came amid a flurry of other abortion restrictions passed in states led by Republicans attempting to test the Supreme Court's new conservative majority.

The nine-judge panel has five Republican appointees, including Justice Brett Kavanaugh, whom President Donald Trump selected to replace Justice Anthony Kennedy. Kavanaugh is generally seen as more conservative than his predecessor.

The ACLU, which has challenged a number of those laws, said in a statement that none of those measures have survived legal scrutiny.

"With this federal court ruling, it's official: None of the state abortion bans passed earlier this year are in effect," the group wrote in a post on Twitter.

In a statement, Attorney General Steve Marshall said that the district court's decision was "not unexpected."

"As we have stated before, the State's objective is to advance our case to the U.S. Supreme Court where we intend to submit evidence that supports our argument that Roe and Casey were wrongly decided and that the Constitution does not prohibit states from protecting unborn children from abortion," he said.

Planned Parenthood v. Casey was a 1992 Supreme Court decision that affirmed the central holding of Roe v. Wade.

Read more: ACLU and Planned Parenthood sue to bar Alabama abortion law from taking effect

The lawsuit was brought by Planned Parenthood and the American Civil Liberties Union in the United States District Court for Middle Alabama. 

The Supreme Court will hear a case this term challenging a Louisiana abortion law that opponents say will limit the state to one provider. The law requires doctors who perform abortions to have admitting privileges at hospitals within 30 miles of their clinics.

tag