A federal district judge has blocked Medicaid work requirements approved by the Trump administration in Arkansas and Kentucky.

Judge James Boasberg, who previously ruled on technical grounds against work requirements in Kentucky, blasted the Trump administration in two decisions Wednesday for failing to consider how many Medicaid beneficiaries would lose coverage under the states’ proposals to require that recipients work in order to receive their benefits. He deemed the approvals of those proposals by the administration to be “arbitrary and capricious” and said that the work requirements could not be allowed to remain in effect.

The rulings are a major loss for the Trump administration on one of its signature health policy crusades: introducing work requirements to Medicaid, the country’s largest health insurance program.

Arkansas was the first state to be allowed to implement Medicaid work requirements and, as a result, nearly 20,000 people have lost health coverage there. Boasbeg began his ruling in the Arkansas case with the tale of one such person, Adrian McGonigal, who sued the state:

In mid-2018, McGonigal learned that he would be subject to new work requirements, which he would have to report online, as a condition of receiving health benefits. These were imposed by the Arkansas Works Amendments (AWA), approved by the U.S. Secretary of Health and Human Services in March 2018. Despite his lack of access to, and difficulty working with, computers, he was able to report his employment in June 2018, but he did not know he needed to continue to do so each month. As a result, when he went to pick up his prescriptions in October, the pharmacist told him that he was no longer covered, and his medicines would cost him $800. In the absence of Medicaid, he could not afford the cost of the prescriptions and so did not pick them up. His 2 health conditions then flared up, causing him to miss several days of work, and Southwest Poultry fired him for his absences. He thus lost his Medicaid coverage and his job.

Policy experts have argued from the start that work requirements were contrary to Medicaid’s purpose of providing health coverage to low-income Americans and that most people who are on Medicaid and can work already do work.

They had also warned that irregular hours and burdensome reporting requirements, rather than failing to work, were more likely to lead to people losing coverage. That was the case with McGonigal.

Boasberg took the unusual step of ruling that the work requirements be halted immediately. Often, in cases like this, the court will put a stay on its own ruling, to avoid disruption in the real world while the case is being appealed, as is expected in this case. But the judge said that the seriousness of the Trump administration’s deficiencies in approving the Medicaid work requirements, and the possible harm to people who would lose coverage if the work requirements were allowed to remain in place demanded that the requirements be halted.

“Weighing the harms these persons will suffer from leaving in place a legally deficient order against the disruptions to the State’s data-collection and education efforts due to vacatur renders a clear answer: the Arkansas Works Amendments cannot stand,” Boasberg wrote to conclude his ruling.

Some of the details differed in the Kentucky case, which had already been fought before Boasberg based on a previous version of the proposal. But in both cases, the judge arrived at the same conclusion: Medicaid work requirements cannot be allowed to stand.