A federal judge in New York Tuesday blocked the Trump administration from adding a citizenship question to the 2020 census.

In a ruling Tuesday, Judge Jesse Furman of the U.S. District Court for the Southern District of New York, vacated Commerce Secretary Wilbur Ross’s decision to add the question to the census questionnaire and enjoined the administration from asking about citizenship on the census "without curing the legal defects" he identified.

"The Court concludes that Secretary Ross’s decision to add the citizenship question to the 2020 census questionnaire, while not inconsistent with the Constitution, violated the [Administrative Procedure Act] in several respects. Those violations are no mere trifles," Furman wrote in his 277-page order.

The Justice Department said it is "disappointed" by the ruling and said Ross "reasonably decided" to include the citizenship question on the upcoming census.

"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," Kelly Laco, spokeswoman for the Justice Department, said. "Reinstating the citizenship question ultimately protects the right to vote and helps ensure free and fair elections for all Americans.”

Steven Camarota, director of research for the Center for Immigration Studies, said including the citizenship question on the upcoming census could help provide information that is "invaluable for research," and noted that if the legal challenge to its addition were to reach the Supreme Court, it may fare better there.

“There is almost no administrative action that the administration can take at this point that won’t be struck down in the courts," he told the Washington Examiner, referring to the success of Trump opponents in finding Democrat-appointed judges who will rule against Trump administration actions . "I don’t think that the ability of activist groups that judge shop is an indication of how the Supreme Court will eventually rule."

The order won praise from the American Civil Liberties Union, which called Furman's ruling a "a forceful rebuke of the Trump administration’s attempt to weaponize the census for an attack on immigrant communities."

“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," Dale Ho, director of the ACLU's Voting Rights Project, said in a statement. "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.”

Ross announced in March that a citizenship question — “Is this person a citizen of the United States?” — would be added to the 2020 census in an effort to ensure better enforcement of the Voting Rights Act.

But the decision promoted a lawsuit, led by New York, from numerous states, cities, and immigrant-rights groups, which asked the court to stop the Trump administration from including the question on the upcoming census.

The plaintiffs argued the Commerce Department's decision to include the citizenship question violated federal law and the Constitution. The inclusion of the question, they warned, would lead to a population undercount that would disproportionately affect states and cities with large immigrant populations.

Additional lawsuits against Commerce are playing out in federal courts from coast-to-coast. One trial in San Francisco started this month and a second in Maryland will begin in the coming weeks.

In his ruling, Furman wrote that Ross’s rationale for adding the citizenship question was not for “enhancement of DOJ’s [Voting Rights Act] enforcement efforts," writing, “It follows that a court cannot sustain agency action founded on a pretextual or sham justification that conceals the true ‘basis’ for the decision."

"The Court can — and, in light of all the evidence in the record, does — infer from the various ways in which Secretary Ross and his aides acted like people with something to hide that they did have something to hide," Furman said in his order.

Furman also said that Ross engaged in a “veritable smorgasbord of classic, clear-cut” violations of the Administrative Procedure Act.

The decision from the U.S. district court is likely to be appealed to the 2nd U.S. Circuit Court of Appeals.

The Supreme Court will wade into the debate over the citizenship question Feb. 19, when it is scheduled to hear oral arguments in a case over evidence that can be considered in the legal challenges. An issue in the dispute is whether Ross can be forced to sit for a deposition.

