WASHINGTON – President Donald Trump on Thursday dropped efforts to get a citizenship question on the 2020 census, saying he would use other means to seek information about the number of noncitizens in the country.

Declaring an executive order directing every federal department to provide any citizenship information it has to the Commerce Department, which conducts the census, Trump said his administration still seeks to determine the citizen and noncitizen populations.

"We will leave no stone unturned," Trump said in brief remarks in the White House Rose Garden.

Trump said he wanted a citizenship question on the census, but a Supreme Court decision two weeks ago has blocked that effort. While he attacked the decision in his remarks, Trump said it would take too long to relitigate the question and his plan should yield the citizenship information anyway.

While Trump said "we're not backing down" on efforts to count citizens and noncitizens, he is backing off on more legal battles. He said they would take too long, and "these delays would have prevented us from completing the census on time."

Trump's plan is similar to one the Commerce Department proposed in late 2017, said attorneys involved in legal battles against the citizenship question. But the administration decided instead to attach a citizenship question to the census itself, triggering litigation that led to last month's decision.

“Trump’s attempt to weaponize the census ends not with a bang but a whimper," said Dale Ho, director of the Voting Rights Project with the American Civil Liberties Union.

Hours earlier, administration officials told reporters Trump was planning to announce an executive order that would authorize a citizenship question on the census.

"We will all go to the beautiful Rose Garden for a News Conference on the Census and Citizenship," Trump said in a morning tweet promoting the social media summit.

But by Thursday afternoon, officials said he would not go that far after all.

During the social media summit, Trump criticized the Supreme Court decision by saying census takers can ask about all sorts of information in households but not ask if the people living there are U.S. citizens.

"It's the craziest thing," Trump said. "Pretty amazing."

House Speaker Nancy Pelosi, D-Calif., who has described Trump's citizenship question as an effort to "make America white again," said the government is already printing census forms.

Census citizenship question:What we know about the debate so far

In its June 27 ruling, the Supreme Court said the administration had not justified its support for a citizenship question, and it sent the matter back to the Commerce Department. The administration could come up with a new justification and relitigate the issue, but that could take months.

Trump and his aides said they had wanted to relitigate the Supreme Court ruling using a different justification, but that would be too time-consuming and last into the 2020 census year.

"We're not going to jeopardize" the ability to conduct the census, Attorney General William Barr said during the White House event.

Adding a citizenship question to the census would have affected about 22 million noncitizens. Even if only a small percentage of them refused to return the questionnaire, it could have altered the allocation of seats in the House of Representatives and about $650 billion in federal funds.

Trump and aides have said the U.S. is entitled to know how many citizens are in the country.

"The president wants to know who is in the country legally and lawfully," said White House spokesman Hogan Gidley. "The American people have a right to know."

Trump's social media summit:Trump's social media summit is stacked with conservative voices. Here's who was invited

In a case decided by a 5-4 vote, Chief Justice John Roberts said he did not find the administration's justification for the question to be credible. The administration had said it needed citizenship data to help prepare for voting rights cases, even though Trump's team has yet to engage in that kind of litigation.

Had Trump pursued a fight in the courts, he almost surely would have lost, several legal experts told USA TODAY on Thursday.

“The census under the Constitution is about counting people, not about partisan redistricting,” said Paul Schiff Berman, a law professor at George Washington University. “The problem is that it’s clear that the (citizenship) question does not need to be asked in order to fulfill the census.”

Aside from being rebuffed by the Supreme Court last month, Berman said the administration plan also was facing a significant hurdle in a federal case brought before a judge in Maryland over whether a citizenship question would violate the Equal Protection Clause that prevents discrimination against any one demographic group, namely Hispanics, who might be undercounted in the process.

Trump’s options were limited, especially given the administration’s own June 30 deadline to start printing millions of census forms, said Justin Levitt, an American constitutional law scholar and former Justice Department official who teaches at Loyola Law School in Los Angeles.

“Congress gives the authority to put stuff on the census to the secretary of commerce. It’s a very specific delegation. This power comes from Congress, not from Article II (of the Constitution),” he said. “The only person who can legally do anything at all on the census is Secretary Ross."

The problem, he said, is that "there is a current federal court injunction on Maryland against Secretary Ross and the Department of Commerce instructing him not to put a citizenship question on the 2020 census."

Census:Federal judge rejects DOJ request to replace census legal team

Contributing: Richard Wolf, Kevin Johnson, Nicholas Wu