Updated

The Supreme Court ruled Wednesday that the Trump administration acted within its authority when it expanded exemptions to the Affordable Care Act’s (ACA) requirement for employers to provide insurance coverage that includes contraception -- in a victory for Little Sisters of the Poor, the Catholic group that has been at the center of the national debate over the mandate.

The court ruled 7-2 in favor of the Trump administration and the Catholic charity that cares for the elderly in two related disputes against Pennsylvania, which sued over the validity of a rule from the Trump administration that allowed religiously-affiliated groups and some for-profit companies to opt-out of providing contraception coverage to employees.

The majority opinion, written by Justice Clarence Thomas, ruled that the Trump administration's challenged rulemaking was aboveboard, and hailed the work of the Little Sisters of the Poor.

U.S. Supreme Court Justice Clarence Thomas participates in taking a new family photo with his fellow justices at the Supreme Court building in Washington, D.C., U.S., June 1, 2017. REUTERS/Jonathan Ernst - RC15CF6608B0

U.S. Supreme Court Justice Clarence Thomas participates in taking a new family photo with his fellow justices at the Supreme Court building in Washington, D.C., U.S., June 1, 2017. REUTERS/Jonathan Ernst - RC15CF6608B0

SUPREME COURT RULES RELIGIOUS SCHOOLS SHIELDED FROM TEACHERS' EMPLOYMENT DISCRIMINATION CLAIMS

"For over 150 years, the Little Sisters have engaged in faithful service and sacrifice, motivated by a religious calling to surrender all for the sake of their brother," Thomas wrote. "But for the past seven years, they -- like many other religious objectors who have participated in the litigation and rulemakings leading up to today’s decision -- have had to fight for the ability to continue in their noble work without violating their sincerely held religious beliefs."

He added: "We hold today that the Departments had the statutory authority to craft that exemption, as well as the contemporaneously issued moral exemption. We further hold that the rules promulgating these exemptions are free from procedural defects."

Little Sisters of the Poor Sister Constance Veit told Shannon Bream on "Fox News @ Night" earlier this year that following the ACA mandate was "unthinkable."

"We dedicate our lives to this because we believe in the dignity of every human life at every stage of life from conception until natural death," Veit said. "So, we've devoted our lives -- by religious vows -- to caring for the elderly. And, we literally are by their bedside holding their hand as they pass on to eternal life. So, it's unthinkable for us, on the one way, to be holding the hand of the dying elderly, and on the other hand, to possibly be facilitating the taking of innocent unborn life."

The Supreme Court also ruled in favor of religious organizations in an employment discrimination case Wednesday. And last week it came down with a ruling that states could not ban religious schools from receiving money from state-funded scholarship programs that are available to non-religious private schools.

Lower court rulings had gone against the administration, with a nationwide injunction putting the exemptions on hold. But the Supreme Court's ruling Wednesday amounts to a huge win for religious conservatives who have been battling the ACA's contraceptive mandate for years.

"It is outrageous that the Obama administration forced a group of nuns to violate their religious beliefs in the first place," Judicial Crisis Network Vice President and Senior Counsel Frank Scaturro tweeted. "The Court’s decision today upholding that exemption is a victory for freedom of religion and conscience—for the Little Sisters and for everyone. Let’s be thankful that the Little Sisters’ ordeal in court has finally ended."

CHIEF JUSTICE ROBERTS INJURED HEAD IN FALL LAST MONTH, WAS HOSPITALIZED

Thomas was joined in his judgment by all the justices except for Sonia Sotomayor and Ruth Bader Ginsburg on Wednesday. Ginsburg raised alarms in her dissent that the ruling could put women's health at risk.

"Today, for the first time, the Court casts totally aside countervailing rights and interests in its zeal to secure religious rights to the nth degree," she wrote. "Destructive of the Women’s Health Amendment, this Court leaves women workers to fend for themselves, to seek contraceptive coverage from sources other than their employer’s insurer, and, absent another available source of funding, to pay for contraceptive services out of their own pockets."

There were two concurring opinions, one written by Justice Samuel Alito and joined by Justice Neil Gorsuch, and another written by Justice Elena Kagan and joined by Justice Stephen Breyer.

In her opinion, Kagan said that she believed the Trump administration had the authority to make the religious exemption to the contraceptive mandate, but that she is suspicious about whether the administration fulfilled "administrative law’s demand for reasoned decisionmaking."

Loraine Marie Maguire (3rd R), mother provincial of the Little Sisters of the Poor, stands alongside fellow nuns following oral arguments in 7 cases dealing with religious organizations that want to ban contraceptives from their health insurance policies on religious grounds at the Supreme Court in Washington, DC, March 23, 2016. / AFP / SAUL LOEB        (Photo credit should read SAUL LOEB/AFP/Getty Images)

Loraine Marie Maguire (3rd R), mother provincial of the Little Sisters of the Poor, stands alongside fellow nuns following oral arguments in 7 cases dealing with religious organizations that want to ban contraceptives from their health insurance policies on religious grounds at the Supreme Court in Washington, DC, March 23, 2016. ((SAUL LOEB/AFP/Getty Images))

LITTLE SISTER OF THE POOR ON DEFYING OBAMACARE MANDATE: 'WE BELIEVE IN THE DIGNITY OF EVERY HUMAN LIFE'

Kagan argues that Pennsylvania could further challenge the religious exemption as "arbitrary and capricious" in lower courts following Wednesday's ruling -- something that the lower courts did not previously rule on because they had decided that the rule was outside of the administration's authority.

Alito's concurrence, on the other hand, argues that Thomas' ruling did not go far enough and that the court should have ruled that the Religious Freedom Restoration Act (RFRA) requires the religious exemption.

"We now send these cases back to the lower courts, where the Commonwealth of Pennsylvania and the State of New Jersey are all but certain to pursue their argument that the current rule is flawed on yet another ground, namely, that it is arbitrary and capricious and thus violates the APA," Alito wrote.

He added: "If RFRA requires this exemption, the Departments did not act in an arbitrary and capricious manner in granting it. And in my judgment, RFRA compels an exemption for the Little Sisters and any other employer with a similar objection to what has been called the accommodation to the contraceptive mandate."

SMITH AND VON SPAKOVSKY: SUPREME COURT'S DECISION ON 'FAITHLESS' ELECTORS IS A VICTORY FOR WE THE PEOPLE

Liberal groups were incensed by the Wednesday decision, which they said was essentially a license to discriminate.

"This is a shameful decision from the Supreme Court," Bridgitte Amiri, the deputy director of the ACLU's Reproductive Freedom Project, said. "Religious liberty is a fundamental right, but it does not grant a license to discriminate. Denying employees and students coverage for birth control will limit their ability to decide whether and when to have a family and make other decisions about their futures. And it will exacerbate existing inequalities, falling hardest on people with the fewest resources and people of color."

Amiri noted that the religious exemption is just that -- an exemption. And most employers will still have to provide birth control in their health care plans under the ACA.

CLICK HERE TO GET THE FOX NEWS APP

But pro-life groups nonetheless carried the day, and Marjorie Dannenfelser, the president of the pro-life Susan B. Anthony List, credited President Trump.

"Today is a major victory for President Trump, who has courageously fought to protect the Little Sisters of the Poor from the Obama-Biden HHS abortifacient mandate," she said. "We commend President Trump for standing strong for the Little Sisters of the Poor – his record stands in stark contrast to that of Joe Biden, who helped launch this assault as Obama’s Vice President nearly a decade ago."

The justices this fall will hear a broader challenge to Obamacare, and requests by the current administration and some red-leaning states to invalidate the entire Affordable Care Act. It is a move opposed by the Democratic-led House and a coalition of other states.

Fox News' Bill Mears and Julia Musto contributed to this report.