The U.S. Supreme Court on Thursday handed President Donald Trump a stinging defeat, blocking his contentious citizenship question planned for the 2020 census because officials gave a "contrived" rationale and prompting Trump to suggest an extraordinary delay in the constitutionally mandated population count.

Conservative Chief Justice John Roberts wrote the 5-4 ruling, joined by the court's four liberals, that will make it difficult for the Trump administration to add the query even if officials offer a new explanation for its need, with the clock ticking toward the deadline for printing the census forms.

The court upheld a key part of a federal judge's January decision barring the question in a victory for a group of states including New York and immigrant rights organizations that challenged the legality of the administration's plan.