WASHINGTON – The Supreme Court temporarily blocked the Trump administration's plan to add a citizenship question to the 2020 census Thursday, giving opponents new hope of defeating it.

The ruling by Chief Justice John Roberts questioned the rationale for the administration's effort, just as challenging states and immigrant rights groups have done.

"The evidence tells a story that does not match the explanation (Commerce Secretary Wilbur Ross) gave for his decision," Roberts wrote. "The sole stated reason seems to have been contrived."

In a complex decision with several dissents and concurrences, the court's four liberal justices said they would have struck down the citizenship question outright, while the court's four other conservative justices said it should have been upheld.

The court's decision doesn't end the dispute. A separate challenge to the administration's motive for asking the citizenship question remains alive in another federal district court. That inquiry could drag on for much of the summer, jeopardizing the timetable for printing the census questionnaire.

Justice Department spokesperson Kelly Laco expressed disappointment over the ruling but said the agency "will continue to defend this administration’s lawful exercises of executive power.”

President Donald Trump tweeted while traveling in Japan, calling it "totally ridiculous that our government ... cannot ask a basic question of citizenship" and urging that the census be delayed until the Supreme Court can be given new information.

More:Trump says he asked lawyers if census could be delayed after Supreme Court decision on citizenship question

But Dale Ho, director of the American Civil Liberties Union's voting rights project, said that "for all intents and purposes, this is over."

“Given how many times they represented that they need to start printing the forms next week, I think it would be the height of hypocrisy for the administration to try and get more time now,” Ho said.

The challenge to the Commerce Department's plan was the most controversial case on the high court's docket, affecting 22 million noncitizens and ultimately the allocation of seats in the House of Representatives and about $650 billion in federal funds.

More:Supreme Court says federal courts cannot strike down partisan gerrymandering schemes

Opponents contended that adding the question was an effort to scare noncitizens into avoiding the census. That in turn would require expanding largely Democratic congressional districts, potentially reducing their overall number. It could cost California, Texas, Florida, New York, Illinois and Arizona seats in Congress.

Commerce Secretary Ross directed the Census Bureau to add the question last year based on the Justice Department's request. He said the "need for accurate citizenship data and the limited burden that the reinstatement of the citizenship question would impose outweigh fears about a potentially lower response rate."

More:Read the full text of the Supreme Court's decision to block a census citizenship question

Three federal district judges separately agreed that Ross' reasons were inadequate under federal law. They noted that he had consulted with White House chief strategist Steve Bannon and Kansas Secretary of State Kris Kobach, both fierce opponents of liberal immigration policies. Only later did the Justice Department ask that the question be added.

Though it had appeared during oral argument that all the court's conservative justices were on the administration's side, Roberts proved the deciding vote. The evidence, he said, "showed that the secretary was determined to reinstate a citizenship question from the time he entered office."

"We do not hold that the agency decision here was substantively invalid," Roberts noted. "But agencies must pursue their goals reasonably. Reasoned decisionmaking under the Administrative Procedure Act calls for an explanation for agency action. What was provided here was more of a distraction."

Associate Justices Clarence Thomas, Samuel Alito, Neil Gorsuch and Brett Kavanaugh dissented from Roberts' conclusions.

"The court's erroneous decision in this case is bad enough, as it unjustifiably interferes with the 2020 census," Thomas wrote. "But the implications of today's decision are broader. With today's decision, the court has opened a Pandora's box of pretext-based challenges in administrative law."

"To put the point bluntly," Alito added, "the federal judiciary has no authority to stick its nose into the question whether it is good policy to include a citizenship question on the census or whether the reasons given by Secretary Ross for that decision were his only reasons or his real reasons."

The lower court judges – all named by President Barack Obama – described acts of subterfuge and misleading statements intended to obscure the real reasons for asking the citizenship question. In the New York case, Judge Jesse Furman called them "the acts and statements of officials with something to hide."

In an expanded, 80-minute oral argument in April that exposed huge divisions among the justices, the Supreme Court's conservatives didn't appear to buy arguments that Ross' plan was illegal or unconstitutional.

The court's four liberal justices appeared dead set against adding the question to the Census Bureau's short form, which goes to every household. They cited the bureau's estimates that it would reduce response rates among households with noncitizens by more than 5%.

Since the case was heard, challengers discovered documents suggesting a political motive in the files of a deceased Republican expert on redistricting who concluded the move could lead to reduced voting power for Hispanics. That would help Republicans and hurt Democrats in congressional elections.

More:Supreme Court's Top Cases of 2019

The census is intended to count anyone residing in the country, so seats in the House of Representatives can be apportioned fairly among the states. The Census Bureau said it needs to begin printing the questionnaire this summer.

Contributing: Kristine Phillips and William Cummings