A federal judge on Wednesday blocked an attempt by Education Secretary Betsy DeVos to keep undocumented and other college students from receiving pandemic relief grants, the second judge in the past week to stop the regulation from taking effect.

U.S. District Judge Yvonne Gonzalez Rogers imposed a preliminary injunction in California preventing the Education Department from restricting emergency grants only to college students who qualify for federal financial aid. The ruling arrives days after U.S. District Judge Thomas O. Rice took similar action in a case involving the state of Washington.

Both orders only apply to schools in those states, but they cast doubt on the future of a policy that higher education leaders have denounced as cruel and ill-conceived.

The rulings are rooted in the Trump administration’s handling of more than $6 billion in emergency grant aid set aside for college students in the stimulus package passed by Congress. The Cares Act directed colleges and universities to dole out emergency grants to students to pay for expenses such as rent, child care, technology and groceries in light of disruption caused by the novel coronavirus.

After confusing and conflicting guidance, DeVos issued a regulation last week asserting that only students eligible for federal financial aid can receive the relief money, shutting out undocumented and international students, as well as those with poor grades, defaulted student loans or minor drug convictions. The rule reaffirms guidelines released by the department in late April that spawned the two lawsuits.

In May, California Community Colleges Chancellor Eloy Ortiz Oakley sued DeVos for “arbitrarily” excluding as many as 800,000 of his students from receiving grants, including those who had not filled out an application for financial aid. Because the only efficient way for colleges to know who is eligible for federal aid is by looking at applications, roughly 7.5 million students across the country without a form on file could not receive grants.

Although Congress directed DeVos to distribute the relief funding to schools in the same way as other financial aid, there is nothing explicit in the law about which students are eligible for grants. The Education Department said that ambiguity required the agency to define eligibility. And since Congress used the federal financial aid framework elsewhere in the legislation, the department said, it concluded that lawmakers intended for grants to be limited to students who are eligible for federal aid.

In her ruling Wednesday, Judge Gonzalez Rogers ripped apart that explanation, accusing the department of having “manufactured ambiguity where none exists.” She said the law mandates DeVos to allocate relief funds to all students except those who already enrolled in online programs prior to the pandemic.

“In light of the emergency nature of the funding at issue and the public health and economic circumstances in which this case arises, the public interest in an injunction is significant,” Gonzalez Rogers wrote.

Chancellor Oakley applauded the ruling Wednesday, calling it “good news for all students who have been denied the assistance that Congress intended for them during this public health crisis.”

Although the injunction is preliminary, higher education experts say the judge’s forceful rebuke of the Education Department signals she may ultimately rule in favor of the community college system.

There is less certainty surrounding the case in Washington state. The judge there also ruled that there is nothing in the Cares Act limiting grants based on financial aid eligibility. But he did not include undocumented students in his injunction, having found arguments on both sides compelling.

The Education Department argues that a 1996 welfare-overhaul law bars undocumented students from getting federal benefits and that there is nothing in the stimulus bill exempting them from the existing law. Attorneys for Washington state contend that if Congress wanted to exclude those students, lawmakers would have been explicit as they were elsewhere in the legislation.

“Two federal judges in the same circuit are split on this issue, and we fully expect to prevail on appeal,” said Angela Morabito, a spokeswoman for the Education Department.

In early April, DeVos told college presidents that the only requirement for the emergency grants was to use the money to cover expenses related to the disruption of campus operations. Otherwise, it was up to them. The funding agreement that colleges have been asked to sign says the grants are not to be considered financial aid. Yet weeks after releasing the aid to schools, DeVos said the money could go only to students who qualify for federal aid programs.

The conflicting messages from the department became more confusing over the ensuing weeks, after the agency said its guidance was unenforceable and promised to release more guidelines.

A recent survey conducted by the National Association of Student Financial Aid Administrators found that the inconsistent guidance from the Education Department slowed the distribution of pandemic relief grants. Of the 587 colleges and universities that participated in the survey, 72 percent had not distributed the funds in May, citing inadequate guidelines from the agency. Still, the vast majority of schools had the money flowing by June.

“Much of those funds went out later than they should and went under confusing and inconsistent guidance,” said Justin Draeger, president of the National Association of Student Financial Aid Administrators. “The recent injunctions clearly indicate that the Department’s reasoning is on very shaky ground. Hopefully, this will translate into broader policy allowances in the future. The bad news is that according to our surveys, most schools have already disbursed emergency grants, and the majority of those have disbursed more than 75 percent of their funding.”