The Supreme Court struck a second blow against the health-care law Monday with its decision to narrow its contraception mandate, an aspect of the federal program that was not central to its existence but was deeply cherished among liberals and many women’s groups.

Two years ago, the court, while upholding the constitutionality of the Affordable Care Act, also gutted the law’s mandatory Medicaid expansion, severely limiting the law’s reach. By contrast, the effect of Monday’s decision is peripheral. The contraception provision was not part of the main law but was laid out in regulatory language issued by the Obama administration. Millions of women who receive birth control at no cost through their company health plans are likely to keep it.

Still, women who work for closely held, for-profit companies whose owners have religious objections to contraceptives may feel an impact. The ruling also is a symbolic setback for a law that has survived a series of legal and political challenges since its enactment four years ago but today stands not entirely whole.

“Obamacare is the single worst piece of legislation to pass in the last 50 years, and I was glad to see the Supreme Court agree that this particular Obamacare mandate violates the [law],” Senate Minority Leader Mitch McConnell (R-Ky.) said in a statement.

Some supporters lamented the ruling but insisted that the law remains strong and that Monday’s decision will have a minimal impact on its core goal: reducing the number of the nation’s uninsured.

They noted that the law itself only required company insurance plans to cover “preventive” services. The Department of Health and Human Services then used guidelines established by the Institute of Medicine to label birth-control pills, intrauterine devices and sterilization methods such as tubal ligation as integral to women’s preventive health.

Arts-and-crafts chain Hobby Lobby and cabinetmaker Conestoga Wood Specialties had objected to contraceptive methods that had the potential to harm a fertilized egg, such as IUDs, which work primarily by preventing fertilization but also may stop a fertilized egg from implanting in the uterus.

“Politically, of course, the case may be trumpeted as a major defeat for the ACA, but that is simply not true,” said Timothy S. Jost, a professor of health law at Washington and Lee University and a supporter of the law. “This case is not about the ACA. It is about religion, about employer and employee’s rights, about corporate law, and I suppose about public health law, but it is not an existential challenge to the ACA.”

It is the latest turn in the tortured path taken by the law, which was enacted in 2010 after a pitched political battle and has encountered obstacle after obstacle since then.

The Supreme Court upheld the constitutionality of the ACA in June 2012, at the same time that it made a major expansion of Medicaid — the state-federal program for the poor — voluntary for states. Since then, 24 states have opted not to enlarge the program. The partial failure of the Medicaid expansion is viewed by the law’s supporters as one of its most significant shortcomings.

A challenge striking more directly at the heart of the law still looms: a wave of suits from citizens and employers who argue that the government is wrongly handing out tax credits to residents in the states that decided not to set up their own insurance marketplaces. If successful, this argument would cut at the heart of the law by making health insurance unaffordable for many people.

The contraception mandate was praised by the law’s supporters, who pointed to it as evidence that the Affordable Care Act was particularly good for women. They hailed the law as an antidote for years of inequality, with women routinely paying more than men for their health care and insurance.

On Friday, the Obama administration touted new figures showing that the number of women who filed prescriptions for oral contraceptives with no co-pays increased from 1.2 million in 2012 to an estimated 5 million in 2013, which officials attributed in part to the health law.

“Women are already benefiting” from the law’s contraception coverage, Cecile Richards, president of Planned Parenthood, told reporters in a teleconference Monday. “We are seeing a great uptake in the benefit. It’s just that there are politicians and now judges who are trying to drag us back to the 1950s.”

But for critics of the law, the mandate became the most high-profile example of a pattern of government overreach by the Obama administration.

In a decision that was widely criticized even by many of the law’s supporters, the mandate initially applied not only to private companies but also to religiously affiliated nonprofits that employ large numbers of workers from various backgrounds, such as Catholic hospitals.

The administration responded by making a change that allowed employees to bypass their employers and get contraception benefits through a third party. But that accommodation did not satisfy many employers. A second wave of legal challenges to the contraception mandate from those nonprofits is making its way through the courts.

“This train-wreck law still does far more harm to American families than good, but it’s encouraging to know that there are limits to the government’s power to coerce,” Rep. Phil Gingrey (R-Ga.) and Rep. Phil Roe (R-Tenn.) said in a joint statement from the House GOP “doctors caucus” Monday.