Boasberg said that top HHS officials “never adequately considered whether [the program] would in fact help the state furnish medical assistance to its citizens, a central objective of Medicaid.” That “signal omission” renders the decision “arbitrary and capricious,” he concluded.

The administration granted Kentucky’s proposal in early January. It marked a profound change in direction to the safety-net health insurance program, which the federal government had never before allowed to impose such conditions on recipients.

The action was a major win for Gov. Matt Bevin (R), who during his 2015 campaign for office had promised to reverse the state’s expansion of Medicaid under the Affordable Care Act. Federal officials have since given Indiana, Arkansas and New Hampshire permission to include work requirements in their own programs, and more states are in line with similar plans.

The lawsuit against Kentucky was brought by three organizations — the National Health Law Program, Kentucky Equal Justice Center and Southern Poverty Law Center — that accused the federal health officials who approved the plan of acting illegally and in conflict with Medicaid law that only Congress has power to change.

Their complaint said that Kentucky’s waiver from regular Medicaid rules meant the Trump administration had “effectively rewritten the statute . . . overturning a half-century of administrative practice, and threatening irreparable harm to the health and welfare of the poorest and most vulnerable in our country.”

Because federal Medicaid law requires states to cover all members of any group of residents they choose to cover, they cannot impose extra eligibility requirements, the organizations alleged.

“The purpose of the Medicaid Act is to furnish medical assistance, and this approval could not stand because it was doing just the opposite — restricting coverage,” Jane Perkins, legal director at the National Health Law Program, said in a statement Friday. “There are better — and legal — ways to help people find work — job training, child care, affordable transportation, and a decent minimum wage.”

Adam Meier, the Bevin administration’s health and family services secretary, stressed the “very narrow basis” of the ruling and said in a statement that Kentucky would work with federal officials to “quickly resolve the single issue raised” by the court. Meier signaled that the state would have “no choice but to make significant benefit reductions” if the plan does not move forward.

An HHS statement said officials were conferring with the Justice Department on their next step.

“Today’s decision is disappointing,” said Seema Verma, administrator of the Centers for Medicare and Medicaid Services. “States are the laboratories of democracy and numerous administrations have looked to them to develop and test reforms that have advanced the objectives of the Medicaid program. The Trump administration is no different.”

Kentucky’s regulations were set to begin taking effect on Sunday. They would require able-bodied Medicaid recipients ages 19 to 64 to work for 80 hours a month or log the same hours of schooling, job-training, volunteering or care-taking.

Through the Medicaid expansion, several hundred thousand residents gained health coverage. In January, state officials had estimated that perhaps 264,000 would not be in compliance with the new requirement by July. Their application to HHS estimated that their plan, which included increased premiums and cost-sharing for nonemergency use of hospital emergency services, would cause more than 95,000 people to leave Medicaid rolls by the fifth year.

The judge noted in his ruling that the record showed little discussion within HHS about the effect of Kentucky’s plan on health coverage.

“For starters, the Secretary never once mentions the estimated 95,000 people who would lose coverage, which gives the Court little reason to think that he seriously grappled with the bottom-line impact on health care,” wrote Boasberg, who was appointed to the U.S. District Court for the District of Columbia by President Barack Obama.