Demonstrators rallied in downtown Austin, days before the restrictive law passed in 2013. ((Emily Ng/Daily Texan via AP)

Federal appeals judges on Tuesday upheld a Texas law requiring nearly all facilities that provide abortions in the state to meet hospital-like standards, a ruling that could leave only a handful open.

A three-judge panel of the U.S. 5th Circuit Court of Appeals ruled that the state’s requirement that abortion clinics meet ambulatory surgical center standards — which include minimum sizes for rooms and doorways, pipelines for anesthesia and other infrastructure — did not impose an undue burden on a “large faction” of Texas women seeking abortions.

Only a handful of Texas abortion clinics — all in major metropolitan areas — meet those standards, which are costly to implement.

“Once again, women across the state of Texas face the near total elimination of safe and legal options for ending a pregnancy, and the denial of their constitutional rights,” said Nancy Northup, president and chief executive of the Center for Reproductive Rights, which filed the lawsuit against 2013’s House Bill 2.

In the lawsuit brought against the state, the Center for Reproductive Rights, on behalf of several Texas abortion providers, also asked the court for a reprieve for two clinics from a separate provision of the law that requires doctors who perform abortions to have admitting privileges at a hospital within 30 miles of an abortion clinic.

One of those clinics, Reproductive Services in El Paso, has since closed. In ruling against exempting the El Paso clinic, the judges found that women in the area did not face a “substantial obstacle” in obtaining an abortion because they could travel to New Mexico for the procedure.

The judges ruled in the provider’s favor in regards to Whole Women’s Health in McAllen, granting an exemption to the law’s most arduous requirements. Since the McAllen clinic stopped performing abortions in late 2013 — and after the closure of a Corpus Christi clinic — women in the Rio Grande Valley must travel more than 200 miles to get an abortion, which the judges said was too far.

But they left in a big caveat — that the McAllen clinic is exempt only until there’s another Texas abortion clinic closer to the Rio Grande Valley than San Antonio.

Ken Paxton, the Texas attorney general, celebrated the ruling, saying the court had validated the state’s “authority to establish safe, common-sense standards of care.”

“HB 2 both protects the unborn and ensures Texas women are not subjected to unsafe and unhealthy conditions,” he said.

But the legal fight is likely to continue. Abortion providers could request that the full 15-member court hear the case or they could attempt to take the matter to the U.S. Supreme Court. The 5th Circuit is considered one of the nation’s most conservative federal appellate courts.

NARAL Pro-Choice Texas Executive Director Heather Busby decried the ruling as a “travesty” that would leave open only eight clinics statewide.

“The 5th Circuit has once again put their political ideology above the law and failed to recognize that HB 2 is an undue burden on Texans’ access to safe, legal and timely abortion,” she said. “Your zip code should not determine your health care.”

Reporter Liz Crampton contributed to this story.

[This story has been cross-posted from the Texas Tribune.]