Washington: Donald Trump ended his quest on Thursday to add a contentious citizenship question to the 2020 census, but insisted he was not retreating from his fight against illegal immigration and said the government would obtain the data by combing through federal records.

"We are not backing down on our effort to determine the citizenship status of the United States population," Trump said in an announcement at the White House.

He said he was ordering every government agency to provide the Department of Commerce with all requested records regarding the number of citizens and non-citizens in the country.

Donald Trump has sought to include a controversial citizenship question in the 2020 census. Credit:Bloomberg

"We will utilize these vast federal databases to gain a full, complete and accurate count of the non-citizen population, including databases maintained by the Department of Homeland Security and the Social Security Administration. We have great knowledge in many of our agencies," Trump said.