The U.S. Supreme Court on Thursday blocked President Donald Trump's attempt to end a program that protects from deportation nearly 650,000 immigrants who entered the country illegally as children.
The justices' 5-4 vote upheld lower court rulings that found that Trump's 2017 action to rescind the Deferred Action for Childhood Arrivals (DACA) program, created in 2012 by his Democratic predecessor Barack Obama, was unlawful.
Chief Justice John Roberts, an appointee of former President George W. Bush who has not joined the court's conservative majority in a few high-profile cases, sided with the court's four liberals in finding that the administration's actions were "arbitrary and capricious" under a federal law called the Administrative Procedure Act.
In the decision, Roberts wrote: "We do not decide whether DACA or its rescission are sound policies. We address only whether the agency complied with the procedural requirement that it provide a reasoned explanation for its action."
The ruling means that the roughly 649,000 immigrants, mostly young Hispanic adults born in Mexico and other Latin American countries, currently enrolled in DACA will avoid deportation and remain eligible to obtain renewable two-year work permits.
The ruling does not prevent Trump from again trying to end the program. But his administration is unlikely to be able to end DACA before the Nov 3 presidential election, in which Trump is seeking reelection against presumptive Democratic candidate Joe Biden.
"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 Conservatives," Trump wrote in one of a flurry of tweets after the DACA ruling.
"I will be releasing a new list of Conservative Supreme Court Justice nominees, which may include some, or many of those already on the list, by September 1, 2020. If given the opportunity, I will only choose from this list, as in the past, a Conservative Supreme Court Justice...Based on decisions being rendered now, this list is more important than ever before (Second Amendment, Right to Life, Religous Liberty, etc.) – VOTE 2020!"
Biden tweeted support for the immigrants in the program, often referred to as "Dreamers".
"Here's my promise to you: On day one, I'll send a bill to Congress that creates a clear roadmap to citizenship for Dreamers and 11 million undocumented people who are already strengthening our nation. It's long overdue."
"The Supreme Court's rejection of President Trump's illegal, immoral attacks on young immigrants is a victory for American values. #Dreamers make America more American," House Speaker Nancy Pelosi tweeted.
After Thursday's ruling, former President Barack Obama wrote on Twitter, "We may look different and come from everywhere, but what makes us American are our shared ideals."
States including California and New York, DACA enrollees and civil rights groups sued to block Trump's plan to end the program. Lower courts in California, New York and the District of Columbia ruled against Trump and left DACA in place.
Government figures show that upwards of 95 percent of current enrollees were born in Latin America, including 80 percent from Mexico, followed by El Salvador, Guatemala and Honduras. Nearly half live in California and Texas. The average age of DACA enrollees is 26.
Liberal justice Sonia Sotomayor, the court's first Hispanic justice, supported arguments made by plaintiffs that the policy may have been motivated by bias against immigrants.
Senator Ted Cruz, a Texas Republican, wrote on Twitter: "The fact that elites in Washington don't see a problem with illegal immigration doesn't answer the reality for the millions of American men and women who do. Chief Justice Roberts' gamesmanship makes a mockery of our rule of law."
The ruling was the second time in a week that Roberts has ruled against Trump in a major case, following Monday's decision that gay and transgender workers are protected under federal employment law.
Roberts a year ago also cast the decisive vote in a Supreme Court loss for the Republican president when the justices blocked the Trump administration from adding a citizenship question to the 2020 Census that critics said was an effort to discourage immigrants from participating.
In 2012, Roberts, who has served as chief justice since 2005, cast the decisive vote in a 5-4 decision to preserve the 2010 Affordable Care Act, also known as Obamacare. The legislation is considered a major achievement of the Obama administration.
The court's four other conservatives, including two Trump appointees, Neil Gorsuch and Brett Kavanaugh, dissented on the DACA decision.
"Today's decision must be recognized for what it is: an effort to avoid a politically controversial but legally correct decision," Justice Clarence Thomas wrote.
Thomas, whose dissent was joined by Gorsuch and Justice Samuel Alito, said DACA itself was "substantively unlawful".
The Trump administration has argued that Obama exceeded his constitutional powers when he created DACA by executive action, bypassing Congress.
States including California and New York, DACA enrollees and civil rights groups sued to block Trump's plan to end the program. Lower courts in California, New York and the District of Columbia ruled against Trump and left DACA in place.
"I feel content. I think the decision was what we deserved, but at the same time I am also thinking we still have to defend the program," said Melody Klingenfuss, a 26-year-old DACA recipient and organizer with the California Dream Network.
University of Chicago Law Professor Jonathon Masur told ABC News that the decision wasn't due to a shift in judicial philosophy.
"This is a procedural ruling rather than a substantive one,"he said. "What they said is the Department of Homeland Security didn't go about it the right way."
Reuters contributed to this story.