WASHINGTON — The Supreme Court ruled Monday that some corporations can hold religious objections that allow them to opt out of the new health law requirement that they cover contraceptives for women.

The justices’ 5-4 decision is the first time that the high court has ruled that profit-seeking businesses can hold religious views under federal law. And it means the Obama administration must search for a different way of providing free contraception to women who are covered under objecting companies’ health insurance plans.

Contraception is among a range of preventive services that must be provided at no extra charge under the health care law that President Barack Obama signed in 2010 and the Supreme Court upheld two years later.

Two years ago, Chief Justice John Roberts cast the pivotal vote that saved the health care law in the midst of Obama’s campaign for re-election. On Monday, dealing with a small sliver of the law, Roberts sided with the four justices who would have struck down the law in its entirety.

Justice Samuel Alito wrote the majority opinion. The court’s four liberal justices dissented.

The court stressed that its ruling applies only to corporations, like the Hobby Lobby chain of arts-and-craft stores, that are under the control of just a few people in which there is no essential difference between the business and its owners.

Alito also said the decision is limited to contraceptives under the health care law. “Our decision should not be understood to hold that an insurance-coverage mandate must necessarily fall if it conflicts with an employer’s religious beliefs,” Alito said.

He suggested two ways the administration could ensure women get the contraception they want. It could simply pay for pregnancy prevention, he said.

Or it could provide the same kind of accommodation it has made available to religious-oriented, not-for-profit corporations. Those groups can tell the government that providing the coverage violates their religious beliefs. At that point, the groups’ insurers or a third-party administrator takes on the responsibility of paying for the birth control.

The accommodation is the subject of separate legal challenges, but the court said Monday that the profit-seeking companies could not assert religious claims in such a situation.

In a dissent she read aloud from the bench, Justice Ruth Bader Ginsburg called the decision “potentially sweeping” because it minimizes the government’s interest in uniform compliance with laws affecting the workplace. “And it discounts the disadvantages religion-based opt outs impose on others, in particular, employees who do not share their employer’s religious beliefs,” Ginsburg said.

The administration said a victory for the companies would prevent women who work for them from making decisions about birth control based on what’s best for their health, not whether they can afford it. The government’s supporters pointed to research showing that nearly one-third of women would change their contraceptive if cost were not an issue; a very effective means of birth control, the intrauterine device, can cost up to $1,000.

Page 2 of 2 - The contraceptives at issue before the court were the emergency contraceptives Plan B and ella, and two IUDs.

Nearly 50 businesses have sued over covering contraceptives. Some, like those involved in the Supreme Court case, are willing to cover most methods of contraception, as long as they can exclude drugs or devices that the government says may work after an egg has been fertilized. Other companies object to paying for any form of birth control.

There are separate lawsuits challenging the contraception provision from religiously affiliated hospitals, colleges and charities.

A survey by the Kaiser Family Foundation found 85 percent of large American employers already had offered such coverage before the health care law required it.

It is unclear how many women potentially are affected by the high court ruling. Hobby Lobby is by far the largest employer of any company that has gone to court to fight the birth control provision.

Oklahoma City-based Hobby Lobby has more than 15,000 full-time employees in more than 600 crafts stores in 41 states. The Greens are evangelical Christians who also own Mardel, a Christian bookstore chain.

The other company is Conestoga Wood Specialties Corp. of East Earl, Pa., owned by a Mennonite family and employing 950 people in making wood cabinets.