A federal judge has blocked a Missouri law banning abortions after eight weeks of pregnancy from taking effect while a challenge to the law is being heard in court.

U.S. District Judge Howard Sachs issued a temporary injunction against the “Missouri Stands for the Unborn Act” on Tuesday.

The act, which was signed into law by Governor Mike Parson in May, bars abortions after eight weeks, except when the life of a mother is determined to be in danger.

Under the law, doctors who perform abortions face 5-15 years in prison, although women are not penalized for seeking abortions.

Planned Parenthood and the ACLU have filed a lawsuit challenging the legislation, saying that it violates Roe v. Wade.

Supporters of the Missouri law had said they were trying to restrict abortion as much as possible without posing a direct challenge to Roe v. Wade. They say that the state has an interest in protecting the lives of both women and unborn babies.

Rep. Nick Schroer (R), one of the bill’s sponsors, had told NPR that the goal was “to save as many lives as we can while withstanding judicial challenges.”

Should the eight-week ban not hold up in court, the law also includes bans at 14 weeks, 18 weeks and 20 weeks, as well as a prohibition on “selective" abortions following a medical diagnosis or disability such as Down syndrome, or on the basis of the race or sex of a baby.

The ban on “selective abortions” was not included in the injunction issued Tuesday, so that portion of the law may continue to be enforced in the state.

Archbishop Robert Carlson of St. Louis voiced his support for the law when it was passed, calling it a “giant step forward for the pro-life movement.”

Catholics “need to continue to show persistence and determination in proclaiming a culture of life,” the archbishop said in a statement released in May.

He highlighted the importance of assisting women in difficult pregnancies and pointed to pro-life clinics in the St. Louis area.

Missouri also has a “trigger law” that would ban all abortions except in cases of medical emergency if Roe v. Wade were to be overturned.

Only one clinic in the state currently performs abortions, and the renewal of its license is currently being disputed in court.