Civil rights groups on Wednesday gave notice in court of their intent to squelch an effort by President Donald Trump to bar people in the U.S. illegally from being included in the head count as congressional districts are redrawn.

Civil rights groups already challenging an order Trump issued last year directing the U.S. Census Bureau to gather citizenship data from administrative records made a request in federal court to expand their complaint to include the new directive Trump issued Tuesday.

A federal judge in Maryland on Wednesday granted the civil rights groups' request during a hearing held by telephone.

“Just when you thought everything was settled yesterday, a new order comes out that makes things unsettled," U.S. District Judge Paula Xinis said.

The civil rights groups' original lawsuit challenged an administrative order that Trump issued last year after the Supreme Court blocked his administration's effort to add a citizenship question to the 2020 census form. Opponents feared a citizenship question would suppress participation by undocumented immigrants and minorities.

Trump's order last year directed the Census Bureau to gather citizenship data from the administrative records of federal and state agencies. Gathering the citizenship data would give the states the option to design districts using voter-age citizen numbers instead of the total population, Trump said in the order.

The lawsuit filed in Maryland by civil rights groups claimed the citizenship data gathering was motivated by “a racially discriminatory scheme” to reduce the political power of Latinos and increase the representation of non-Latino whites. The administrative data also was often inaccurate, they said.

The Census Bureau currently is in the middle of its once-a-decade head count that determines the distribution of $1.5 trillion in federal spending and how many congressional seats each state gets in a process known as apportionment. More than 62% of the nation's households have already responded, and census takers last week started knocking on the doors of homes whose residents haven't yet responded. The bureau this week mailed out 34.3 million postcards to households reminding them to answer the census questionnaire.

Attorneys for the U.S. government had asked the judge to dismiss the Maryland lawsuit.

Xinis said Wednesday that she had been inclined to do so because there was no way of knowing whether state legislatures would use the citizenship data when redrawing legislative districts, which would raise questions about whether the plaintiffs had what is known as “standing" to make their challenge, and some states would have to change their laws to do so.

But Trump’s newest order “really changes the landscape," she said.

“The first executive order is tied to the second executive order," Xinis said. “The second executive order is buttoning up some of the concerns we all had as far as standing."

Follow Mike Schneider on Twitter at https://twitter.com/MikeSchneiderAP.