Minnesota universities can continue offering in-state tuition and scholarships to some immigrants without legal status, after a federal judge dismissed a lawsuit brought by the U.S. Department of Justice, according to a ruling issued Friday. U.S. District Judge Katherine Menendez rejected the government’s bid to halt Minnesota’s programs, finding that the federal government failed to show the programs discriminate against U.S. citizens.

Menendez said the Justice Department misinterpreted the federal law at the center of the case, which bars states from providing certain preferential benefits to immigrants in the country illegally if they have not met eligibility requirements. In the judge’s view, the state programs rely on whether students attended a Minnesota high school for at least three years, rather than on where they live in the U.S. or on their immigration status.

The lawsuit, filed last summer, named Democratic Gov. Tim Walz and Democratic state Attorney General Keith Ellison as defendants, along with the state’s Office of Higher Education. The Justice Department argued that Minnesota’s statutes violate federal law by offering in-state tuition and scholarships to students living in the country illegally if they attended a Minnesota high school for three years, while U.S. citizens who attended school outside the state cannot receive the same benefits. The government said the state statutes “flagrantly” violate the federal restriction.

In remarks tied to the DOJ’s lawsuit, Pamela Bondi—identified in the case as the Justice Department’s lead figure at the time—said, “No state can be allowed to treat Americans like second-class citizens in their own country by offering financial benefits to illegal aliens.” Menendez’s ruling disagreed with that reading. The judge said the DOJ’s interpretation did not match how the Minnesota benefits are granted, because students who attended a Minnesota high school for at least three years receive the same public benefits regardless of where they have U.S. residency or immigration status.

The judge also dismissed claims against the governor and attorney general, saying the Justice Department did not have standing to sue them because they do not have power to change the state laws that determine tuition eligibility. Ellison responded by celebrating the decision, saying in a statement Friday that Minnesota had “defeated another one of Donald Trump’s efforts to misconstrue federal law to force Minnesota to abandon duly passed state laws and become a colder, less caring state.”

Ellison also described the policy as beneficial to the state’s workforce, writing that funding for immigrants without legal status represents an “investment for our state to do everything we can to encourage a more educated workforce.” The Justice Department did not immediately respond to a request for comment Friday.

The Minnesota ruling comes as the Justice Department has pursued similar litigation tied to state immigration-related eligibility decisions. In the Texas case mentioned in the AP report, a federal judge blocked that state’s law providing a tuition break to students living in the country illegally after the state’s Republican attorney general, Ken Paxton, said he supported the legal challenge.

In recent litigation activity described by the report, Florida ended in-state tuition eligibility for immigrants living in the country illegally. The National Immigration Law Center said at least 22 states and the District of Columbia have laws or policies granting the in-state benefit, including Democratic-leaning states such as California and New York as well as GOP-leaning states such as Kansas and Nebraska. The center said at least 14 states, including Minnesota, allow immigrant students without legal status to receive financial aid and scholarships on top of in-state tuition.