President Donald Trump on Thursday dropped a fight to put a citizenship question on the upcoming 2020 census — but ordered federal agencies to give the Commerce Department all records they have that are related to how many citizens and non-citizens live in the United States.

Trump did not, as had he had been expected earlier in the day, issue an executive order mandating that the question to be asked on the census.

Legal experts had said such an order would not likely survive court challenges.

Attorney General William Barr said at the press conference with Trump that the question will not be asked on the census, acknowledging that a recent Supreme Court ruling had made doing so difficult, if not impossible.

"We're not going to jeopardize our ability to carry out the census," Barr said.

Trump defended his original plan to have the question asked, and claimed that his order directing agencies to share citizenship data would make the actual count of non-citizen "far more accurate" than it would have been if the question was on the census.

But Dale Ho, director of the ACLU's Voting Rights Project, who argued the Supreme Court case challenging the citizenship question, said afterwards: "Trump's attempt to weaponize the census ends not with a bang but a whimper."

"He lost in the Supreme Court, which saw through his lie about needing the question for the Voting Rights Act," Ho said. "It is clear he simply wanted to sow fear in immigrant communities and turbocharge Republican gerrymandering efforts by diluting the political influence of Latino communities."

Ho added: "Now he's backing down and taking the option that he rejected more than a year ago. Trump may claim victory today, but this is nothing short of a total, humiliating defeat for him and his administration."

And another lawyer who battled the administration over the citizenship question suggested that Trump's order could have no practical consequences.

"I don't know quite what he is referring to because existing law allows, in fact, encourages the Census Bureau to obtain information from other federal agencies," said John Libby, a partner at the law firm Manatt, who was part of a team that successfully argued against the addition of the question in federal court in California.

"I don't want to characterize its effectiveness or lack of effectiveness, but it is pretty consistent with existing law."

Trump repeatedly said during the day Thursday that asking someone what their citizenship was should not be controversial, and was something that the government was entitled to know to function properly.

"The Department of Commerce sensibly decided to include a citizenship question on the 2020 census as has been done many, many times throughout the history of the United States," Trump said. "Unfortunately this effort was delayed by meritless litigation."

"The Supreme Court ultimately affirmed our right to ask the citizenship question, and very strongly it was affirmed," the president said. "But the Supreme Court also ruled that we must provide further explanation that would have produced even more litigation."

The president said those delays "would have prevented us from completing the census on time."

He called the situation "deeply regrettable."

"I am hereby ordering every department and agency in the federal government to provide the Department of Commerce with all requested records regarding the number of citizens and noncitizens in our country," Trump said.

"They must furnish all legally accessible records in their possession immediately. We will utilize these vast federal databases to gain a full, complete and accurate count of the noncitizen population, including databases maintained by the Department of Homeland Security and the Social Security Administration."

Justice Department spokesman Kerri Kupec said, in a statement "The Supreme Court held that [Commerce] Secretary [Wilbur] Ross reasonably concluded that including the citizenship question on the 2020 decennial census would provide the most complete and accurate citizenship information, but it invalidated his decision to include that question on other grounds."

"The Department of Justice disagrees with the Supreme Court's decision. Today's Executive Order represents an alternative path to collecting the best citizenship data now available, which is vital for informed policymaking and numerous other reasons," Kupec said. "Accordingly, the Department will promptly inform the courts that the Government will not include a citizenship question on the 2020 decennial census."

Earlier in the day, the president had been expected at that press event to announce an executive action mandating that participants in the census be asked if they are a U.S. citizen or not.

Tweet

The Supreme Court in a decision last month effectively barred the Trump administration from adding such a question to the census, as it had planned to do.

Last week, administration officials said census forms would be printed without the question.

But on the heels of their comments, Trump announced on Twitter that he would not abandon the effort to add the question.

"We are absolutely moving forward, as we must, because of the importance of the answer to this question," Trump wrote.

He later told reporters, when asked if he would issue an executive order: "We're thinking about doing that."

"It's one of the ways," he added. "We have four or five ways we can do it. It's one of the ways and we're thinking about doing it very seriously."

Justice Department lawyers told a federal judge last Friday that they would continue legal efforts to add the citizenship question.

But in their filing that offered no explanation of how the Justice Department believed it could win that fight.

Earlier this week, two federal judges dealt the Trump administration a setback by refusing to replace the lawyers who had handled the cases with new attorneys, saying the Justice Department had failed to justify the switch.

— CNBC's Kevin Breuninger contributed to this report