WASHINGTON (Reuters) - The U.S. Supreme Court on Monday struck down a Texas abortion law imposing strict regulations on doctors and facilities in the strongest endorsement of abortion rights in America in more than two decades.

The 5-3 ruling held that the Republican-backed 2013 Texas law placed an undue burden on women exercising their right under the U.S. Constitution to end a pregnancy, established in the court’s landmark 1973 Roe v. Wade decision.

The abortion providers who challenged the law said it was medically unnecessary and specifically intended to shut clinics.

Texas officials said it was intended to protect women’s health. The ruling means similar laws in other states are probably unconstitutional and could put in jeopardy other types of abortion restrictions enacted in various conservative states.

“The decision should send a loud signal to politicians that they can no longer hide behind sham rationales to shut down clinics and prevent a woman who has decided to end a pregnancy from getting the care she needs,” said Jennifer Dalven, a lawyer with the American Civil Liberties Union.

President Barack Obama, whose administration backed the abortion providers in the court challenge, said in a statement he was “pleased to see the Supreme Court protect women’s rights and health” and that restrictions like those in Texas “harm women’s health and place an unconstitutional obstacle in the path of a woman’s reproductive freedom.”

Conservative Justice Anthony Kennedy joined the court’s four liberal members in the ruling, with the remaining three conservatives dissenting. The court declared that both key provisions of the law - requiring abortion doctors to have difficult-to-obtain “admitting privileges” at a local hospital and requiring clinics to have costly hospital-grade facilities - violated a woman’s right to an abortion.

Writing for the court, liberal Justice Stephen Breyer said, “We conclude that 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 added.

Deferring to state legislatures over “questions of medical uncertainty is also inconsistent with this court’s case law,” Breyer added.

The ruling in the case, Whole Woman’s Health v. Hellerstedt, represented the most vigorous affirmation of abortion rights in the United States since a 1992 ruling affirmed a woman’s right to have the procedure.

On a warm sunny summer day, hundreds of people on both sides of the issue converged on the Supreme Court building, with abortion rights advocates dancing and celebrating after the ruling. “We’re ecstatic. The reality is today women won,” abortion rights activist Marcela Howell said.

The law was passed by a Republican-led legislature and signed by a Republican governor in 2013. Ten states currently have admitting privileges requirements on the books while six have laws requiring hospital-grade facilities. Lower courts have blocked admitting privileges provisions in five states and halted facilities regulations in two states.

Slideshow ( 10 images )

“The decision erodes states’ lawmaking authority to safeguard the health and safety of women and subjects more innocent life to being lost. Texas’ goal is to protect innocent life, while ensuring the highest health and safety standards for women,” Republican Texas Governor Greg Abbott said.

Since the law was passed, the number of abortion clinics in Texas, the second-most-populous U.S. state with about 27 million people, had dropped from 41 to 19.

The Supreme Court has appeals pending in two cases involving admitting privilege laws in Mississippi and Wisconsin on which it could act as soon as Tuesday.

Slideshow ( 10 images )

The Texas law required abortion doctors to have “admitting privileges,” a type of formal affiliation, at a hospital within 30 miles (48 km) of the clinic so they can treat patients needing surgery or other critical care.

The law also required clinic buildings to possess costly, hospital-grade facilities. These regulations covered numerous building features such as corridor width, the swinging motion of doors, floor tiles, parking spaces, elevator size, ventilation, electrical wiring, plumbing, floor tiling and even the angle that water flows from drinking fountains.

PUBLIC OPINION SPLIT

Americans remain closely divided over whether abortion should be legal. In a Reuters/Ipsos online poll involving 6,769 U.S. adults conducted from June 3 to June 22, 47 percent of respondents said abortion generally should be legal and 42 percent said it generally should be illegal.

Views on abortion in the United States have changed very little over the decades, according to historical polling data.

The last time the justices decided a major abortion case was nine years ago when they ruled 5-4 to uphold a federal law banning a late-term abortion procedure.

Amy Hagstrom Miller, founder and CEO of Whole Woman’s Health, which led the challenge to the Texas law, said, “Every day Whole Woman’s Health treats our patients with compassion, respect and dignity - and today the Supreme Court did the same. We’re thrilled that today justice was served and our clinics stay open.”

Presumptive Democratic presidential nominee Hillary Clinton on Twitter called the ruling “a victory for women in Texas and across America.”

“This fight isn’t over: The next president has to protect women’s health. Women won’t be ‘punished’ for exercising their basic rights,” she said, a dig at presumptive Republican presidential nominee Donald Trump, who once suggested women who get illegal abortions should face “some sort of punishment.” The presidential election is Nov. 8.

Some U.S. states have pursued a variety of restrictions on abortion, including banning certain types of procedures, prohibiting it after a certain number of weeks of gestation, requiring parental permission for girls until a certain age, imposing waiting periods or mandatory counseling, and others.

“It’s exceedingly unfortunate that the court has taken the ability to protect women’s health out of the hands of Texas citizens and their duly-elected representatives,” Texas Attorney General Ken Paxton, a Republican, said in a statement.

Chief Justice John Roberts, Justice Clarence Thomas and Justice Samuel Alito dissented. The normally nine-justice court was one member short after the Feb. 13 death of conservative Justice Antonin Scalia, who consistently opposed abortion in past rulings.