The ruling from U.S. District Judge Richard Seeborg is the second order from a federal judge blocking the question. In January, a federal judge in New York blocked the Trump administration from adding the question, saying the administration ran afoul of the Administrative Procedure Act, a federal law that requires an agency to carefully study an issue before implementing a change in policy. Instead of carefully studying adding the citizenship question, Commerce Secretary Wilbur Ross came up with a “pretextual” rationale for adding it, the judge said.

A federal judge in California blocked the Trump administration Wednesday from adding a citizenship question to the 2020 census , saying the decision ran afoul of federal law and was unconstitutional.

The Trump administration said it was adding the question to the census because the Department of Justice requested it do so to better enforce the Voting Rights Act. Many critics, including former Justice Department officials, questioned that claim, saying the department already has good enough data. They noted that the decennial census has not asked about citizenship since 1950, while the Voting Rights Act was passed in 1965.

In the New York case, the Commerce Department produced documents showing that Ross was interested in adding the citizenship question long before the Justice Department made its request in December 2017. Shortly after he was confirmed, he expressed frustration to an aide that the Commerce Department wasn’t moving faster to add the question. Ross also overruled career census staff who produced analyses showing that the untested question was likely to cause fewer people to self-respond to the census. The documents also revealed Ross asked DOJ to make the request for the citizenship question.

Daniel Tokaji, a law professor at Ohio State University, said Wednesday’s ruling “gives teeth to the Enumeration Clause,” which he described as an unsettled and important area of constitutional law.

“There’s not just a smoking gun here, there’s a smoking bazooka,” Tokaji wrote in an email. “The idea that the purpose of this was to enhance enforcement of the Voting Rights Act doesn’t pass the straight face test.”

“To the contrary, the record leaves no doubt that the purpose was to suppress participation and representation, especially by Latinos,” he continued. “While the Court applies a fairly deferential form of review under the Enumeration Clause, the absence of a legitimate interest is fatal.”

The U.S. Supreme Court has already agreed to hear an appeal of the New York case in April, but Seeborg’s ruling on Wednesday went further than the one in the New York case. He said that adding the citizenship question violated the Enumeration Clause of the U.S. Constitution, which requires the federal government to count all persons in the United States every 10 years. The question was unconstitutional, Seeborg said, because it would cause fewer people to respond to the census.

“The record in this case has clearly established that including the citizenship question on the 2020 Census is fundamentally counterproductive to the goal of obtaining accurate citizenship data about the public. This question is, however, quite effective at depressing self-response rates among immigrants and noncitizens, and poses a significant risk of distorting the apportionment of congressional representation among the states,” Seeborg wrote.

“In short, the inclusion of the citizenship question on the 2020 Census threatens the very foundation of our democratic system ― and does so based on a self-defeating rationale,” he continued. “In light of these findings, Defendants do not get another bite at the apple. Defendants are hereby enjoined from including the citizenship question on the 2020 Census, regardless of any technical compliance with the APA.”

The suit was brought by the state of California as well as several cities and counties there and Black Alliance for Just Immigration, an advocacy group.

“Justice has prevailed for each and every Californian who should raise their hands to be counted in the 2020 Census without being discouraged by a citizenship question. We celebrate this ruling, an important step in protecting billions of dollars meant for critical services Californians rely on, from education, to public health and safety,” said California Attorney General Xavier Becerra (D). “And we will ardently defend this important judgment to safeguard fairness in funding and representation for California and its local communities.”

Kristen Clarke, president and executive director of the Lawyers’ Committee for Civil Rights Under Law, which represented some of the plaintiffs, released a statement in support of the ruling.

“In no uncertain terms, the plaintiffs have proved that the justification given for the addition of the citizenship question was nothing more than a pretext to carry out the Trump Administration’s racist agenda,” she said.

This story has been updated with more background information on the citizenship question and reactions to the ruling.

CORRECTION: An earlier version of this story misspelled U.S. District Judge Richard Seeborg’s surname.