WASHINGTON -- The Supreme Court ruled broadly Wednesday in favour of the religious rights of employers in two cases that could leave more than 70,000 women without free contraception and tens of thousands of people with no way to sue for job discrimination.

In both cases the court ruled 7-2, with two liberal justices joining conservatives in favour of the Trump administration and religious employers.

In the more prominent of the two cases, involving U.S. President Barack Obama's health care overhaul, the justices greenlighted changes the Trump administration had sought. The administration announced in 2017 that it would allow more employers to opt out of providing the no-cost birth control coverage required under the law, but lower courts had blocked the changes.

The ruling is a significant election-year win for President Donald Trump, who counts on heavy support from evangelicals and other Christian groups for votes and policy backing. It was also good news for the administration, which in recent weeks has seen headline-making Supreme Court decisions go against its positions.

In one of those earlier cases, the court rejected Trump's effort to end legal protections for 650,000 young immigrants. In another, the justices said a landmark civil rights law protects gay, lesbian and transgender people from discrimination in employment.

Another particularly important decision for Trump is ahead. The justices are expected to announce Thursday whether Congress and the Manhattan district attorney can see the president's taxes and other financial records he has fought to keep private.

In its second big ruling on Wednesday, the court sided with two Catholic schools in California in a decision underscoring that certain employees of religious schools can't sue for employment discrimination.

Lay teachers whose contracts had not been renewed had sued their schools. But Justice Samuel Alito wrote in his majority opinion: "When a school with a religious mission entrusts a teacher with the responsibility of educating and forming students in the faith, judicial intervention into disputes between the school and the teacher threatens the school's independence in a way that the First Amendment does not allow."

The court's birth-control decision was cheered by conservative groups, and White House spokeswoman Kayleigh McEnany joined in. "Today's Supreme Court ruling is a big win for religious freedom and freedom of conscience," she said in a statement.

Liberal groups and Democrats, including House Speaker Nancy Pelosi, decried the decision, which she called a "fundamental misreading" of the health care law. Presumptive Democratic presidential nominee Joe Biden said the decision will make it "easier for the Trump-Pence Administration to continue to strip health care from women."

The Trump administration is still seeking to overturn Obama's Affordable Care Act in its entirety. It has joined Texas and other Republican-led states in calling on the justices to do just that. The case is scheduled to be argued in the court term that begins in October.

Justice Clarence Thomas, writing for the majority of the court, said in Wednesday's decision that the administration has the authority to make its birth-control coverage changes and followed appropriate procedures in doing so.

The government has estimated that the rule changes would cause between 70,000 women and 126,000 women to lose contraception coverage in one year.

Justice Ruth Bader Ginsburg cited those numbers in dissenting.

"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 in a dissent joined by Justice Sonia Sotomayor.

Birth control coverage has been a topic of contention since the health care law was passed.

"The ACA's contraceptive mandate ... has existed for approximately nine years. Litigation surrounding that requirement has lasted nearly as long," Thomas wrote.

Initially, churches, synagogues and mosques were exempt from the contraceptive coverage requirement. The Obama administration also created a way by which religiously affiliated organizations including hospitals, universities and charities could opt out of paying for contraception, but women on their health plans would still get no-cost birth control. Some groups complained the opt-out process itself violated their religious beliefs, and years of legal wrangling followed.

After Trump took office, officials announced changes. Under a new policy issued by the Department of Health and Human Services, more categories of employers, including publicly traded companies, can opt out of providing no-cost birth control to women by claiming religious objections. The policy also allows some employers, though not publicly traded companies, to raise moral objections and do the same.

The changes were blocked by courts after New Jersey and Pennsylvania challenged them.

Future administrations could attempt to alter the Trump administration rules. And two liberal justices who sided with the administration, Elena Kagan and Stephen Breyer, suggested the legal fight over the administration's changes may continue.

Pennsylvania Attorney General Josh Shapiro said in a statement after the ruling, "This fight is not over."

In the religious-schools discrimination case, the court had ruled unanimously in 2012 that the Constitution prevents ministers from suing their churches for employment discrimination, but the justices didn't rigidly define who counts as a minister.

Associated Press writer Mark Sherman contributed to this report.