The decision was 5-3.

Passed in 2013, the law said clinics providing abortion services must meet the same building standards as ambulatory surgical centers. And it required doctors performing abortions to have admitting privileges at nearby hospitals.

Since the law was passed, the number of clinics providing abortion services in Texas dropped to 19 from 42. Opponents said that number would fall to ten if the Supreme Court upheld the law.

The Center for Reproductive Rights called the law “an absolute sham,” arguing that abortion patients rarely require hospitalization and that many patients simply take two pills.

Justice Stephen G. Breyer in writing the majority opinion said “neither of these provisions offers medical benefits sufficient to justify the burdens upon access that each imposes. Each places a substantial obstacle in the path of women seeking a pre-viability abortion, each constitutes an undue burden on abortion access, and each violates the Federal Constitution.”

Breyer was joined in the majority by Justices Ruth Bader Ginsburg, Elena Kagan and Anthony M. Kennedy and Sonia Sotomayor. Chief Justice John G. Roberts Jr., Samuel A. Alito Jr. and Clarence Thomas dissented.

In writing his dissent, Alito said “The Court favors petitioners with a victory that they did not have the audacity to seek.”

“If anything, when a case involves a controversial issue, we should be especially careful to be scrupulously neutral in applying such rules,” Alito wrote. “The Court has not done so here. On the contrary, de­termined to strike down two provisions of a new Texas abortion statute in all of their applications, the Court simply disregards basic rules that apply in all other cases.”

Thomas in his own strident dissent criticized what he sees as “the Court’s troubling tendency ‘to bend the rules when any effort to limit abortion, or even to speak in opposition to abortion, is at issue’.”