Donald Trump has erupted with anger after his administration ended its effort to add a citizenship question to the 2020 US census.

The White House and Justice Department said it would begin printing forms without the contentious query, despite the US president saying last week he would attempt to indefinitely delay the census until the query was added.

It came after a Supreme Court ruling on 27 June faulted the administration for its original attempt to include it.

“A very sad time for America when the Supreme Court of the United States won’t allow a question of ‘Is this person a Citizen of the United States?’ to be asked on the #2020 Census! Going on for a long time” Mr Trump tweeted late on Tuesday.

“I have asked the Department of Commerce and the Department of Justice to do whatever is necessary to bring this most vital of questions, and this very important case, to a successful conclusion. USA! USA! USA!”

Mr Trump’s suggestion the question could still appear on the census contrasted with commerce secretary Wilbur Ross, who said he would “respect” the ruling despite disagreeing with it.

“The Census Bureau has started the process of printing the decennial questionnaires without the question. My focus, and that of the bureau and the entire department, is to conduct a complete and accurate census," Mr Ross said.

Although the Supreme Court left open the possibility of the administration adding the question, there was little time left for the government to come up with a new rationale.

Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam Show all 30 1 /30 Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam Members of the Proud Boys, a fascist group, jeer at anti-Trump protesters outside of the president's 2020 campaign launch in Orlando, Florida Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam A supporter dressed as Uncle Sam poses at Uncle Sam Reuters Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam A baby blimp rears its head amidst a group of anti-Trump protesters outside the president't campaign launch in Orlando, Florida Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam President Trump addresses supporters at the launch event of his 2020 election campaign in Orlando, Florida Reuters Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam Proud Boys have adopted Fred Perry polo shirts as their uniform and many members have the name of the group tattooed on their arms Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam A line of police officers separate opposing groups of protesters outside the launch of President Trump's 2020 campaign launch Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam A protester hits a Trump punching bag during a protest outside Trump's 2020 campaign launch in Orlando, Florida Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam Twin Trump supporters pose for a photo at the president's 2020 campaign launch in Orlando, Florida Reuters Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam A protester dressed as a caricature of Donald Trump stands outside the president's 2020 campaign launch in Orlando, Florida AP Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam A Trump supporter faces off against a protester outside the president's campaign launch in Orlando, Florida AFP/Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam A Proud Boy shouts across the police line at anti-Trump protesters outside the president's campaign launch in Orlando, Florida Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam A Trump supporter poses for a photo at the president's 2020 campaign launch in Orlando, Florida Reuters Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam A Proud Boy jeers at anti-Trump protesters who are separated from the president's supporters by a police line outside the president's campaign launch in Orlando, Florida Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam A man dressed as Uncle Sam poses at President Trump's 2020 campaign launch in Orlando, Florida Reuters Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam An anti-Trump protester faces off against a supporter outside the president's campaign launch in Orlando, Florida AFP/Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam Members of the Proud Boys, a fascist group, jeer at anti-Trump protesters outside of the president's 2020 campaign launch Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam A child holds a 2020 US "dollar bill" that features Donald Trump's face at the president's 2020 campaign launch EPA Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam Anti-Trump protesters rally outside the president's 2020 campaign launch in Orlando, Florida Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam Anti-Trump protesters rally outside the president's 2020 campaign launch in Orlando, Florida Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam Numerous baby Trump balloons are raised in protests outside of the president's 2020 campaign launch in Orlando, Florida Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam A supporter wears a T-shirt depicting Trump as a hero at the president's 2020 campaign launch in Orlando, Florida Reuters Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam President Trump addresses supporters at the launch event of his 2020 election campaign in the Amway Centre in Orlando, Florida AFP/Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam An anti-Trump protester calls for the president to be impeached outside the launch event for his 2020 campaign launch in Orlando, Florida Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam Supporters of Donald Trump face off against protesters outside of the president's 2020 campaign launch in Orlando, Florida AP Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam A baby blimp rises behind a group of anti-Trump protesters outside the president's campaign launch in Orlando, Florida AP Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam A supporter dressed as Uncle Sam poses at President Trump's 2020 campaign launch in Orlando, Florida AP Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam A member of the Proud Boys, a fascist group, holds a sign up outside of the president's 2020 campaign launch in Orlando, Florida AFP/Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam A supporter bears a Trump flag at the president's 2020 campaign launch in Orlando, Florida Reuters Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam Protesters hold baby Trump balloons in the rally outside of the president's 2020 campaign launch in Orlando, Florida Getty Trump 2020 launch: Fascist Proud Boys, baby blimps and Uncle Sam An anti-Trump protester holds a sign accusing the president of being a traitor Getty

The government had said in court filings that it needed to finalise the details of the questionnaire by the end of June.

Critics have called the citizenship question a Republican ploy to scare immigrants into not taking part in the population count and engineer an undercount in Democratic-leaning areas with high immigrant and Latino populations.

That would benefit non-Hispanic whites and help Mr Trump's fellow Republicans gain seats in the US House of Representatives and state legislatures, the critics said.

“In light of the Supreme Court's ruling, the Trump administration had no choice but to proceed with printing the 2020 census forms without a citizenship question,” said Dale Ho, a lawyer with the American Civil Liberties Union, which had fought the Trump administration in court.

"Everyone in America counts in the census, and today's decision means we all will."

The Trump administration had told the courts its rationale for adding the question was to better enforce a law that protects the voting rights of racial minorities. Critics called that rationale a pretext, with the Supreme Court's majority embracing that theory.

The court's 5-4 ruling, which saw conservative chief justice John Roberts join the court's four liberals in the majority, ultimately proved decisive.

“While the Trump Administration may have attempted to politicise the census and punish cities and states across the nation, justice prevailed, and the census will continue to remain a tool for obtaining an accurate count of our population,” said New York attorney general Letitia James, who also challenged the question.

Donald Trump promises tanks for Fourth of July parade

The census is used to allot seats in the US House of Representatives and distribute some $800bn (£637bn) in federal funds. Opponents have said the citizenship question would instil fear in immigrant households that the information would be shared with law enforcement, deterring them from taking part.

Citizenship status has not been asked of all households since the 1950 census. Since then, it was included only on questionnaires sent to a smaller subset of the population.

Manhattan-based US district judge Jesse Furman ruled on 15 January the Commerce Department's decision to add the question violated the Administrative Procedure Act. Federal judges in Maryland and California also have issued rulings to block the question.

Mr Furman said the evidence showed that Mr Ross had concealed his true motives for adding the citizenship question and that he and his aides had convinced the Justice Department to request it.

Evidence surfaced in May that the challengers said showed the administration's plan to add a citizenship question was intended to discriminate against racial minorities.