A federal judge blocked the Trump administration from adding a citizenship question to the 2020 census, a win for critics who say the question is unnecessary and would cause fewer immigrants and minorities to respond to the decennial survey.

The Trump administration is expected to swiftly appeal the Tuesday ruling from U.S. District Judge Jesse Furman of the Southern District of New York.

Several states and activists said immigrants, fearful of volunteering their immigration status to the Trump administration, would refuse to respond. The plaintiffs in the suit ― 18 states, the District of Columbia, several cities and a handful of immigrant rights groups ― argued the Trump administration intended to drive down the response rate among those groups when it added the question and ran afoul of a federal statute requiring them to rationally consider evidence and input before making a policy decision.

In his opinion, Furman wrote the way the Trump administration added the question violated the federal statute, the Administrative Procedure Act (APA). The law, Furman wrote, requires agencies to carefully study an issue before it implements or changes a policy. The Trump administration failed to do that in adding the citizenship question and the public rationale given by Commerce Secretary Wilbur Ross, who oversees the Census Bureau, Furman said, was “pretextual.”

“Most blatantly, Secretary Ross ignored, and violated, a statute that requires him, in circumstances like those here, to collect data through the acquisition and use of ‘administrative records’ instead of through ‘direct inquiries’ on a survey such as the census,” Furman wrote.

“Additionally, Secretary Ross’s decision to add a citizenship question was ‘arbitrary and capricious’ on its own terms: He failed to consider several important aspects of the problem; alternately ignored, cherry-picked, or badly misconstrued the evidence in the record before him; acted irrationally both in light of that evidence and his own stated decisional criteria; and failed to justify significant departures from past policies and practices ― a veritable smorgasbord of classic, clear-cut APA violations,” he continued.

While Furman found the Trump administration violated the APA, he said the evidence in the record did not show the decision to add the question was unconstitutional and motivated by an intent to discriminate.

Dale Ho, the director of the ACLU’s Voting Rights Project, which represented some of the plaintiffs at trial, praised Furman’s decision.

“This ruling is a forceful rebuke of the Trump administration’s attempt to weaponize the census for an attack on immigrant communities,” he said in a statement. “The evidence at trial, including from the government’s own witness, exposed how adding a citizenship question would wreck the once-in-a-decade count of the nation’s population. The inevitable result would have been — and the administration’s clear intent was — to strip federal resources and political representation from those needing it most.”

Kelly Laco, a Justice Department spokeswoman, said the Trump administration acted within its legal authority.

“We are disappointed and are still reviewing the ruling. Secretary Ross, the only person with legal authority over the census, reasonably decided to reinstate a citizenship question on the 2020 census in response to the Department of Justice’s request for better citizenship data, to protect voters against racial discrimination,” she said in a statement. “Not only has the government asked a citizenship question in the census for most of the last 200 years, 41 million households have already answered it on the American Community Survey since 2005. Our government is legally entitled to include a citizenship question on the census and people in the United States have a legal obligation to answer. Reinstating the citizenship question ultimately protects the right to vote and helps ensure free and fair elections for all Americans.”

Because the data in the census is so valuable, officials rigorously test questions before they are added to the survey. The citizenship question, however, has not been sufficiently tested, according to Furman.

In his opinion, Furman found that while the citizenship question had been tested for the American Community Survey (ACS), which goes out to a few million households each year, it had not been tested on the decennial census, which goes out to every household. The Trump administration argued the ACS question testing was adequate for the decennial, but Furman said it was not. The ACS questions, he wrote, were last tested in 2006 and the “macroenvironment” has changed considerably since then.

An inaccurate census would have severe and lasting consequences. The survey is used to determine how congressional seats are allocated to the states and how roughly $675 billion in federal funds are disbursed.

The Trump administration argued that it was well within its authority to add the question and that doing so would not depress the overall response rate. Even if fewer people initially chose to respond to the survey voluntarily, the Census Bureau had robust plans to follow up with people, officials said. Furman disagreed, writing that the inclusion of a citizenship question would mean “hundreds of thousands — if not millions — of people will go uncounted in the census.”

Administration officials were warned that adding the question would likely cause fewer people to voluntarily respond, but chose to add the question anyway, plaintiffs said. The plaintiffs also said the government’s decision to add the question was “arbitrary” and “capricious” and presented evidence showing officials wanted to add the question even before a formal request to do so was made.

Throughout the litigation, government officials have repeatedly appealed incremental rulings in the case to the U.S. Court of Appeals for the 2nd Circuit and the U.S. Supreme Court.

While the census asks about citizenship on surveys that go out to a sample of households, it has not asked about the matter on the decennial survey, which goes to every American household, since 1950.

ASSOCIATED PRESS Commerce Secretary Wilbur Ross has changed his story on why his department wants to add a question about citizenship to the decennial census.

Ross said in March that he began exploring adding the question after the Justice Department said it needed better citizenship data to enforce it. But documents disclosed as part of the lawsuit revealed that Ross was interested in adding the question months before the Justice Department sent him its request. Ross also disclosed he was the one who initially approached the Justice Department about making the request.

In his 277-page opinion, Furman thoroughly worked through all of the ways Ross had ignored and misrepresented evidence showing adding a citizenship question was a bad idea. He found that Ross and top Commerce Department aides became set on adding a citizenship question in early 2017, sought a way to do it that could potentially withstand legal scrutiny, and were not going to stop no matter what the evidence showed.

The former head of the Justice Department’s civil rights division, responsible for enforcing the Voting Rights Act, also said in a deposition that he was unsure whether citizenship data potentially collected in the census would be more accurate than the data it currently has access to. The statement supported the plaintiffs’ argument that the DOJ did not really need a citizenship question on the census and its request for one was driven by other motivations.

There is an ongoing dispute in the trial over what evidence could be considered in reaching the decision. The Justice Department argued that courts should not be allowed to consider information about the decision other than the documents it voluntarily assembled. The plaintiffs fought to have access to more information and wanted to depose Ross, but the Supreme Court blocked them from doing so in October.

The Supreme Court will hear oral argument on what evidence the courts can consider in the case in February. But In his opinion, Furman made it clear that the evidence the Justice Department had volunteered on its own was sufficient to show Ross broke the law.

This story has been updated with quotes from Furman’s opinion, Ho and Laco.