A federal judge has struck down Texas restrictions on a common second-trimester abortion procedure, ruling that the law blocks a woman’s constitutionally guaranteed right to an abortion.

The Texas law, Senate Bill 8, which was supposed to go into effect in September, would have required doctors to stop the heart of a fetus before it could be removed in an abortion. U.S. District Court Judge Lee Yeakel ruled that the law imposed an unnecessary medical procedure on women with no known benefit to them.

“The Act does not further the health of the woman before the fetus is viable,” Yeakel wrote in the Nov. 22 decision.

“That a woman may make the decision to have an abortion before a fetus may survive outside her womb is solely and exclusively the woman’s decision,” Yeakel ruled. “The power to make this decision is her right.”

Whole Woman’s Health, Planned Parenthood and several other reproductive rights groups sued over the law, which would have blocked common “dilation and evacuation” abortions.

Texas Attorney General Ken Paxton has already filed a notice of appeal, reports The Dallas Morning News.

Yeakel wrote that the state’s “legitimate interest in fetal life” does not allow it to require an additional medical procedure “not driven by medical necessity” to complete a standard D&E abortion.

“The court is unaware of any other medical context — in contravention of the doctor’s medical judgement and the best interest of the patient — to conduct a medical procedure that delivers no benefit to the woman,” he wrote.

District courts exist to preserve constitutional rights, including a woman’s right to a second-trimester abortion, Yeakel added. “Once the Supreme Court has defined the boundaries of a constitutional right, a district court may not redefine those boundaries,” he said in his opinion.

The law was passed to block dismemberment of a fetus in an abortion before its heart stopped. But abortion providers argued that methods to stop a fetal heartbeat — which include cutting the umbilical cord or injecting potassium chloride or digoxin into a fetus — could cause health risks to the woman.

At least seven other states have similar laws, which are being challenged in six of those, reports Politico. Last month an Alabama court also threw out the law, saying it imposed “significant health risks” to women, as Yeakel noted in his order.

Senate Bill 8, which included the ban, also requires in another section that fetal remains from miscarriages and abortions be buried or cremated. A U.S. District Court judge ruled in January that those rules “likely are unconstitutionally vague and impose an undue burden on the right to an abortion.” Paxton appealed that decision, and the legal challenge is still pending.