Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

The U.S. Supreme Court on Monday struck down one of the nation's toughest restrictions on abortion, a Texas law that women's groups said would have forced more than three-quarters of the state's clinics to shut down.

The decision was 5-3.

Read the decision

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.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

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.”

Related: Shuttered the End of Abortion Access in Red America

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'.”

Pro-choice advocates dance outside the Supreme Court where justices are weighing a case that imposes heavy restrictions on abortion clinics in Texas on June 26. JIM LO SCALZO / EPA

Surgical patients undergo a ten-minute procedure without general anesthesia in the outpatient setting of a doctor's office or clinic, the group said, and complications from abortion are extremely rare.

Texas defended the restrictions, saying that states have wide discretion to pass laws in areas where there is medical and scientific uncertainty. The state said the law was passed "to ensure patient safety and raise standards of care."

The court's decision will affect similar laws in twelve other states, some now on hold because of court challenges. The restrictions in Texas represented a new front in efforts to restrict abortion by focusing on protecting the health and safety of the mother rather than the life of the fetus.

Wide-shot of courtroom on last day of opinions, 2015-16 Term. Art Lien

At the heart of the case was the standard for assessing abortion limits first announced by the Supreme Court in 1992. State laws cannot create an "undue burden" on a woman's constitutional right to terminate her pregnancy before the fetus attains viability, it said then.

A law imposes such a burden, the court said in the case of Planned Parenthood v. Casey, if its "purpose or effect is to place substantial obstacles in the path" of a woman seeking to exercise that right.

Read: Europe's Abortion Fight

Planned Parenthood celebrated the ruling.

"We are thrilled that these dangerous provisions have been struck down," Cecile Richards, president of Planned Parenthood Federation of America said in a statement. "This is a win for women. Every person must have the right to make their own personal decisions about abortion, and we will fight like hell to ensure they do."

Presumptive Democratic presidential nominee Hillary Clinton weighed in on the ruling via Twitter saying the decision "is a victory for women in Texas and across America. Safe abortion should be a right—not just on paper, but in reality."