[Mr. Barr said a legal path to census citizenship question exists, but he gave no details.]

Stanton Jones, a lawyer with the firm of Arnold & Porter who helped represent opponents of the question in a federal lawsuit in Manhattan, accused the Trump administration of waging a multimillion-dollar court battle that from its inception was a plot to advance Republican political interests.

“The citizenship question was always a cynical ploy to rig American elections for partisan and racially discriminatory reasons,” he said.

Government experts predicted that asking the question would result in many immigrants refusing to participate in the census, leading to an undercount of about 6.5 million people. That could reduce Democratic representation when congressional districts are allocated in 2021 and affect how hundreds of billions of dollars in federal spending are distributed.

In a statement, a Justice Department spokeswoman said the department would “promptly inform the courts” that the government would not seek to include a citizenship question on the census.

The United States has never had a central registry of citizens and noncitizens, and in theory Mr. Trump’s order could result in one. But data sharing is supposed to go only in one direction: from other agencies into the Census Bureau but not back out.

The Census Bureau for decades has relied on data from other agencies to check the accuracy of their head counts. For the purposes of obtaining citizenship data, the Census Bureau could identify American citizens with some precision by mining immigration data from the federal Citizenship and Immigration Services agency, which is part of the Department of Homeland Security, and data from programs that require citizenship to participate, such as Social Security numbers and some taxpayer identification numbers. Other citizenship data come from the Census Bureau’s American Community Survey, which asks a small fraction of the population questions — including on citizenship — every month.

Although noncitizens often falsely respond that they are citizens on the survey, data from other agencies would help weed out those responses. That would provide a reasonably accurate portrayal of citizenship even down to census blocks, the bureau’s smallest population unit, said John Thompson, who ran the bureau from 2013 to 2017.