The US Supreme Court has ruled against President Donald Trump’s bid to end a major programme that protects young immigrants from deportation.
The justices upheld lower court rulings that found his move to rescind Deferred Action for Childhood Arrivals (Daca) was “unlawful”.
It protects “Dreamers”, about 650,000 young people who entered the US without documents as children.
The Trump administration has sought to end the Obama-era policy since 2017.
The Supreme Court took up the case after lower courts ruled that the Trump administration did not adequately explain why it was ending the programme, criticising the White House’s “capricious” explanations.
On Thursday, the justices voted 5-4 to uphold the lower courts’ findings that the administration’s order violated the Administrative Procedure Act, which says a government action cannot make policy that is “arbitrary, capricious, an abuse of discretion or otherwise not in accordance with law” or “unsupported by substantial evidence”.
Mr Trump denounced the decision in a series of tweets.
“These horrible & politically charged decisions coming out of the Supreme Court are shotgun blasts into the face of people that are proud to call themselves Republicans or Conservative,” he wrote.
Former President Barack Obama praised the ruling and urged voters to elect a Democratic president and Congress in November to ensure “a system that’s truly worthy of this nation of immigrants once and for all”.
Joe Biden, the 2020 Democratic presidential nominee, said he would seek to make the programme permanent should he beat Mr Trump.
Chief Justice John Roberts, often described as a conservative, sided with the court’s four liberals in Thursday’s majority ruling.
It marked the second time this week that Chief Justice Roberts has ruled against Mr Trump.
On Monday, the court ruled that gay and transgender workers are protected under federal employment law, a major victory for LGBT campaigners.
That decision was written by Justice Neil Gorsuch, a Trump appointee.
During his presidency, Mr Trump has appointed one other justice, Brett Kavanaugh. The Supreme Court’s bench is widely regarded as the most conservative in modern history.
Yet last year Chief Justice Roberts again joined his liberal-leaning counterparts in preventing the Trump administration from adding a question on citizenship to the 2020 census, which opponents had argued would suppress responses from immigrants and racial minorities.
The court has, however, sided with the Trump administration in two other major cases.
It defended the White House’s travel ban affecting mostly Muslim countries, and allowed Mr Trump’s ban on transgender people in the military to go into effect.