Commerce Secretary Wilbur Ross attends a Cabinet meeting at the White House on July 18, 2018. A federal judge on Friday ordered Ross to testify in a lawsuit on a question about citizenship added to the U.S. census. (Leah Millis/Reuters)

A federal judge ordered Commerce Secretary Wilbur Ross to sit for a deposition in a lawsuit challenging Ross’s addition of a question about citizenship to the U.S. census, in a new opinion filed Friday.

The government had sought to shield Ross from answering questions about his decision to ask U.S. residents filling out the census questionnaire about their citizenship, a decision which attorneys general from 17 states and the District say discriminates against predominantly immigrant communities.

The 18 attorneys general plus several cities bringing the lawsuit, led by New York Attorney General Barbara Underwood, say that as the Trump administration takes numerous actions to curtail both legal and illegal immigration, a question about citizenship would frighten some residents, especially immigrants, so much that they would not fill out the census at all. Their communities would then be undercounted, leading the government to provide less federal funding for services like roads and schools.

While Ross has testified about the question before Congress and wanted to avoid a deposition in this lawsuit, U.S. District Judge Jesse M. Furman wrote in an order Friday “the question is not a close one: Secretary Ross must sit for a deposition because, among other things, his intent and credibility are directly at issue in these cases.”

A spokesman said on Friday evening that the Department of Commerce will not comment on the case, which is State of New York et. al. v. U.S. Department of Commerce et. al.

Amy Spitalnick, a spokeswoman for the New York attorney general’s office, said on Friday that Ross’s answers will be crucial to the case. “Secretary Ross testified to Congress that [the Department of Justice] initiated the request for the citizenship question because of Voting Rights Act concerns; yet documents show otherwise, instead reflecting Secretary Ross’ concern for reducing representation of communities with large immigrant populations. We look forward to getting to the bottom of this as we continue our suit to ensure a full and fair Census,” she wrote in an email.

Furman said that the U.S. Court of Appeals for the 2nd Circuit, which covers New York, ruled in 2013 that high-ranking government officials should only be called to testify in exceptional circumstances, since they have “greater duties and time constraints than other witnesses.” Thus, the court ruled, such officials should only be deposed if they have firsthand knowledge or if other sources cannot provide the same information.

Furman said this case meets both of those standards. The heart of the issue is Ross’s own intention in adding the question to the census.

To avoid imposing too much of a burden on Ross, Furman limited the deposition to four hours.

The government is likely to appeal the ruling.

Furman pointed to evidence found by the attorneys general that suggests Ross took a strong interest in getting the citizenship question added himself, repeatedly raising the topic despite objections from experts within the Census Bureau.

Ross said in his testimony before Congress that he looked into adding the question at the request of the Department of Justice in December 2017, but filings in the lawsuit prompted him to state in a memo that in fact he asked the Justice Department about the idea months earlier, in February 2017.

Furman pointed out that his ruling is not unprecedented, recalling a 1999 case in which the secretary of the interior was compelled to testify and a 1971 case in which the secretary of transportation was deposed and testified at trial, among others.

Tara Bahrampour contributed to this report.