The U.S. Supreme Court ruled this week that closely held, for-profit companies can claim a religious exemption to a provision in the Affordable Care Act that requires contraception coverage for female employees.

At issue in the case were regulations issued by the Department of Health and Human Services under the Affordable Care Act, which includes a provision that requires specified employers to cover contraceptives in their employee health care plans at no cost to their female employees. Churches and religious nonprofit organizations are exempt from this contraceptive mandate.

The case, Burwell v. Hobby Lobby, arose from a lawsuit filed by Hobby Lobby, a Christian-owned craft supply chain store, and Conestoga Wood Specialties Store, a wood manufacturer owned by a family of Mennonites, who argued that the provision violated their religious beliefs.

In a 95-page opinion authored by Justice Samuel Alito, the court concluded in a 5-4 vote on June 30 that the HHS regulations “violate [the Religious Freedom Restoration Act], which prohibits the federal government from taking any action that substantially burdens the exercise of religion unless that action constitutes the least restrictive means of serving a compelling government interest.”

“Since RFRA applies in these cases, we must decide whether the challenged HHS regulations substantially burden the exercise of religion, and we hold that they do,” Alito wrote. “If the owners comply with the HHS mandate, they believe they will be facilitating abortions, and if they do not comply, they will pay a very heavy price—as much as $1.3 million per day, or about $475 million per year, in the case of one  of the companies. If these consequences do not amount to a substantial burden, it is hard to see what would.” Alito was joined by Chief Justice John Roberts and Justices Antonin Scalia, Clarence Thomas and Anthony Kennedy.

The narrowly-defined ruling concerns only the contraceptive mandate. The court said the decision should not be understood to hold that employers can object to all insurance-coverage mandates, such as vaccinations or blood transfusions, if they conflict with an employer's religious beliefs.

Not all the Justices agreed with the court's reasoning.  In a dissent, Justice Ruth Bader Ginsburg wrote that “the court's determination that RFRA extends to for-profit corporations is bound to have untoward effects. Although the court attempts to cabin its language to closely held corporations, its logic extends to corporations of any size, public or private.”

Justice Sonia Sotomayor joined Ginsburg's dissent that companies don't have the right to assert religious rights under RFRA. Justices Stephen Breyer and Elena Kagan, while agreeing with Justice Ginsburg that the plaintiffs' challenge to the contraceptive coverage requirement fails on the merits, did not decide whether either for-profit companies or their owners may bring claims under the RFRA.