A US appeals court won't immediately let President Donald Trump end an Obama-era program shielding young immigrants from deportation.
The Trump administration's Department of Homeland Security ended the policy "based on serious doubts about its legality and the practical implications of maintaining it", the Justice Department wrote in a court filing Monday.
DACA is the 2012 program set up by President Obama that granted a tentative amnesty from deportation to hundreds of thousands of Dreamers - illegal immigrants who came to the U.S.as children, grew up here, and in many cases don't know their home countries.
During a hearing in May, Deputy Assistant Attorney General Hashim Mooppan argued that the courts could not review the administration's decision to end DACA and defended the move against assertions that it was arbitrary and capricious.
The ruling represented another legal defeat for Trump over DACA, although he has won court victories on other parts of his hard-line immigration policies.
Lawsuits by California and others challenging the Trump administration's decision will continue in federal court while the injunction remains in place.
Trump said on Wednesday he saw potential to work with Democrats, who won control of the House of Representatives this week, but he would have to see how the Supreme Court rules on the issue.
US District Judge William Alsup rejected the argument that then-President Barack Obama had exceeded his power in creating DACA and said the Trump administration failed to consider the disruption that ending the programme would cause.
The administration in February unsuccessfully appealed Alsup's ruling to the Supreme Court.
The Trump administration has said it moved to end the programme previous year because Texas and other states threatened to sue, raising the prospect of a chaotic end to DACA.
The Department of Homeland Security moved to end the program a year ago on the advice of just-fired Attorney General Jeff Sessions, who determined DACA to be unlawful because, he said, President Barack Obama did not have the authority to adopt it in the first place. Trump's action sparked an outcry from immigration advocates, business groups, colleges and some religious leaders. The program allows about 700,000 young immigrants to stay and work in the United States.
The ruling comes just days after the Trump administration asked the Supreme Court to take over three cases concerning pending lawsuits that seek to preserve DACA. "Our decision today does not curb that power, but rather enables its exercise in a manner that is free from legal misconceptions and is democratically accountable to the public", wrote Judge Kim McLane Wardlaw, an Obama appointee to the appeals court.
"Had the judge not ruled that way, I think we would have made a deal", Trump said at a news conference.
The decision is likely to be appealed to the Supreme Court.
Options that have been discussed are extending DACA or providing a path to citizenship in exchange for funding for a wall along the US-Mexico border.