President Donald Trump has criticised the US courts after a judge blocked him from ending protection for children brought illegally to the US by parents.
Mr Trump said the court system was “broken and unfair”.
In September, he rescinded Deferred Action for Childhood Arrivals (Daca), but San Francisco Judge William Alsup said it had to stay while litigation against Mr Trump’s move continued.
The Obama-era scheme protects some 800,000 people.
It also provides temporary permits for work and study.
Mr Trump attacked the ruling on Twitter: “The opposing side in a case (such as DACA) always runs to the 9th Circuit and almost always wins before being reversed by higher courts.”
Judge Alsup’s court is the District Court for the Northern District of California. The Ninth US Circuit Court of Appeals commonly examines appeals of rulings made in Judge Alsup’s court and others.
Earlier, White House press spokeswoman Sarah Sanders described the ruling as “outrageous”.
What did the San Francisco judge order?
In his ruling, Judge Alsup stated that “the government is hereby ordered and enjoined, pending final judgment herein or other order, to maintain the Daca programme on a nationwide basis on the same terms and conditions as were in effect before the rescission”.
He said the justice department’s argument that the scheme was illegal was based on a “flawed legal premise”.
The district judge ordered the government to process renewal applications from people who had previously been covered.
However, this would not be the case for those who had never before received protection under the programme.
When did Mr Trump want to end Daca?
Despite scrapping the programme in September, President Trump delayed enforcement to give Congress until March to enact a replacement plan for Daca recipients, who are known as “Dreamers”.
On Tuesday, Democrats and Republicans announced that they would work together on a new immigration bill to protect border security, chain migration, the visa lottery system and the Daca.
Democrats have repeatedly said that they will block any legislation that contains funding for the border wall with Mexico – a key campaign pledge of Mr Trump’s.
What is Daca?
In order to qualify for the 2012 scheme, applicants under the age of 30 were required to submit personal information to the Department of Homeland Security, including addresses and phone numbers.
They had to pass an FBI background check, have a clean criminal background, and either be in school, recently graduated or have been honourably discharged from the military.
In exchange, the US government agreed to “defer” any action on their immigration status for a period of two years.
The majority of dreamers are from Mexico and other Latin American countries.
The justice department has said no current Daca recipients will be affected by the decision to scrap the scheme before 5 March 2018, but no new applications will be taken.