“This move directly targets states like New York that have large, thriving immigrant populations, threatening billions of dollars in federal funding for New York as well as fair representation in Congress and the Electoral College,” Mr. Schneiderman said Tuesday.

California Attorney General Xavier Becerra filed suit over the move hours after it was announced Monday night, and New Jersey Attorney General Gurbir Grewal said his state would join the coalition.

The new question would mirror one that is already on the bureau’s annual American Community Survey. It asks whether a person is a citizen by birth or by naturalization or isn’t a citizen. It doesn’t ask about the legality of an immigrant’s presence.

Civil rights groups and minority advocates said the question will dissuade immigrants from answering the census altogether, resulting in an undercount of noncitizens. Mr. Schneiderman and others say this could adversely affect states with large immigrant populations.

The 10-year census seeks to count every American. The federal government relies on the tallies to allocate congressional seats, craft poverty guidelines and distribute billions of dollars in funding for programs like Medicaid. The move also poses practical concerns because test forms for the 2020 count have already been sent without the new query.

“There’s a big risk,” said John Thompson, who was Census Bureau director until last year. “I don’t think it’s an acceptable risk.”