Texas can ban the abortion procedure most commonly used to end second-trimester pregnancies, a federal appeals court ruled Wednesday.

The decision was hailed as a major victory by antiabortion advocates, even as doctors warned it could leave women less safe.

And it comes as the Supreme Court prepares to hear arguments in another case, whether Mississippi can ban abortions after 15 weeks. The decision in that case could have far-reaching implications, further curbing the constitutional right granted under 1973’s landmark Roe v. Wade ruling.

The Texas ruling on Wednesday could also end up in front of the Supreme Court, law experts predicted. It revolved around a procedure known as dilation and evacuation, or D&E.

D&E is a standard medical procedure and safest form of abortion after approximately 15 weeks of pregnancy, according to the American College of Obstetricians and Gynecologists (ACOG), which added that it results in fewer complications for women.

But many Republican lawmakers, who refer to the procedure as “dismemberment abortions,” oppose it because doctors must first stop the heartbeat of a fetus and then remove pieces of fetal tissue.

Kimberlyn Schwartz, director of media and communications with Texas Right to Life, said in a statement that “anyone can see the cruelty of dismemberment abortions, ripping a child’s body apart while her heart is still beating.”

Since 91 percent of abortions nationally are performed before 15 weeks, Wednesday’s ruling won’t impact the majority of abortion procedures.

Several other states have attempted to ban D&E, including Alabama, Arkansas, Indiana, Kansas, Kentucky, Louisiana, Ohio and Oklahoma. But those laws have all been struck down, at least in part, by the courts.

The Texas ban on D&Es was passed by the state legislature in 2017. The law makes the procedure illegal; doctors who perform a D&E procedure could be fined or face two years in prison.

The legislation was challenged in court nearly as soon as it was passed. Last October, the measure was struck down by a three-judge panel of the U.S. Court of Appeals for the 5th Circuit, which wrote that the measure “unduly burdens a woman’s constitutional protected right” to an abortion.

But the full 5th Circuit, acting on an appeal from Texas, reheard the case in front of all 17 judges in an en banc review. In that rehearing, nine judges ruled in favor of the ban, five dissented and three were recused.

Appellate Judge James Dennis wrote in his dissent that the law would force women to unnecessarily undergo “painful, invasive, expensive, and in some cases experimental additional treatments” that pose “significantly elevated risks to the women’s health.”

Under the Texas law, doctors can only terminate second-trimester pregnancies using alternative methods. But experts say those other methods are less safe than D&E, posing serious health risks such as infection, uterine perforation or death.

“Doctors will be forced, by ill-advised, unscientifically motivated policy, to provide lesser care to patients,” ACOG said in a statement.

“Texas has been hellbent on legislating abortion out of existence, and it is galling that a federal court would uphold a law that so clearly defies decades of Supreme Court precedent,” said Nancy Northup, president and CEO of the Center for Reproductive Rights.

Texas has enacted 26 abortion restrictions in the past decade, including a restriction on abortions after six weeks of pregnancy, which is being challenged in court.

While other states have passed similar “heartbeat laws,” the Texas legislation does not create a state ban of the procedure. Instead, it allows abortion providers who perform abortions after six weeks could be sued, along with anyone who helps a woman access the abortion. They can seek up to $10,000 per defendant.

The Texas Tribune reports that supporters of the bill hope this provision will trip up legal challenges to the legislation, since the state is not enforcing an official ban.

It allows abortions in the case of a medical emergency, but not in cases of rape or incest.

“Our creator endowed us with the right to life, and yet millions of children lose their right to life every year because of abortion,” Texas Gov. Greg Abbott (R) said at the signing ceremony, which was broadcast live on Facebook. “In Texas we work to save those lives.”

Women in Texas are banned from using telehealth to see their provider for a medication abortion, which means patients not only have to physically come into a clinic for care, but also most have to make two trips.

Marcela Howell, founder and president of In Our Own Voice: National Black Women’s Reproductive Justice Agenda, said in a statement that Black women already face barriers to accessing reproductive health care, the kinds that can delay abortion care until the second trimester.

“As Black women and pregnant people, our fight has never been about the right to abortion care, it has been about surmounting the federal and state barriers that prevent us from accessing that care,” Howell said.

But Elissa Graves, legal counsel with Alliance Defending Freedom, a conservative group that filed a friend of the court brief, supporting the ban, called Wednesday’s law the right thing to do for pregnant women. And, “both humane and constitutional.”

“Texas has the right to respect the life of unborn children, and it did so when it chose to strictly limit the gruesome procedure of dismemberment abortions,” Graves said.