A federal judge in Texas blocked two key parts of the state’s controversial abortion law Monday, ruling that one part is unconstitutional while another provision imposes an undue burden on women in some instances.

The ruling by U.S. District Judge Lee Yeakel represents a legal victory for abortion providers, who had challenged new requirements that abortion doctors must have admitting privileges at a hospital within 30 miles of their clinic and that all abortions must take place in surgical centers, rather than allowing women to take abortion drugs at home.

Lauren Bean, spokeswoman for Texas Attorney General Greg Abbott, said the state immediately appealed the ruling.

Eleven abortion clinics and three doctors filed a federal lawsuit last month saying that the requirements, which were to take effect Tuesday, would end abortion services in more than a third of the state’s licensed facilities and eliminate services in Fort Worth and five other major cities. Abbott had said the new restrictions, adopted in summer, were aimed at providing better medical protections for women and fetuses.

The provision requiring doctors to obtain hospital admitting privileges “does not bear a rational relationship to the legitimate right of the State in preserving and promoting fetal life or a woman’s health and, in any event, places a substantial obstacle in the path of a woman seeking an abortion of a nonviable fetus and is thus an undue burden to her,” Yeakel wrote.

Judges in four other states — Alabama, Mississippi, North Dakota and Wisconsin — have issued either preliminary injunctions or temporary restraining orders blocking admitting-privilege requirements, but Yeakel issued a permanent injunction in his decision.

On the question of whether women should be required to take two doses of medication to terminate a pregnancy under a doctor’s supervision on two different days, the judge issued a more limited injunction, ruling that while these provisions “do not generally place an undue burden on a woman seeking an abortion, they do if they ban a medication abortion where a physician determines, in appropriate medical judgment, such a procedure is necessary for the preservation of the life or health of the mother.”

Yeakel enjoined the provisions in those instances, meaning a doctor could determine that a patient could undergo a medication abortion at home rather than in a doctor’s office.

“The women in Texas have had a huge victory today,” said Brigitte Amiri, a senior staff attorney at the American Civil Liberties Union and a member of the trial team, in an interview. On the question of medication abortions, Amiri said the plaintiffs were still “assessing our decision about next steps after assessing what the court has said.”

In a statement, Abbott’s spokeswoman said, “we appreciate the trial court’s attention in this matter,” but made it clear that Yeakel would not have the last word on the matter.

“As everyone — including the trial court judge — has acknowledged, this is a matter that will ultimately be resolved by the appellate courts or the U.S. Supreme Court,” Bean said.

State Sen. Wendy Davis (D-Tex.), who rose to national prominence by waging a marathon filibuster aimed at blocking the bill’s passage, issued a statement saying, “Texas families are stronger and healthier when women across the state have access to quality healthcare.”

“I’m not surprised by the judge’s ruling,” said Davis, who, along with Abbott, is running for governor. “As a mother, I would rather see our tax dollars spent on improving our kids’ schools rather than defending this law.”

The lawsuit did not challenge another provision in the law banning abortions after 20 weeks. That restriction is the subject of litigation in federal court in Arizona and state court in Georgia.