YinYang/iStockBy DEVIN DWYER, ABC News(WASHINGTON) — The Supreme Court handed President Donald Trump a major defeat Thursday, blocking his 2017 decision to end the Deferred Action for Childhood Arrivals program, or DACA.The majority opinion, written by Chief Justice John Roberts, overturns Trump’s decision to cancel the program on the grounds he gave at the time.The Department of Homeland Security’s decision to rescind DACA is reviewable and that the “DHS’s decision to rescind DACA was arbitrary and capricious under the” Administrative Procedures Act, Roberts wrote.Roberts said there’s no question President Trump has the power to end DACA but the issue was how he did it — the reasons he gave and the process he failed to follow.”The dispute before the Court is not whether DHS may rescind DACA. All parties agree that it may. The dispute is instead primarily about the procedure the agency followed in doing so.”He says Trump and DHS did not adequately consider the impact on the DACA recipients themselves and the potential hardships for the some 700,000 young immigrants brought to the U.S. illegally as children by their parents.DACA recipients outside the court were jubilant on hearing the news.Apparently in response to the ruling, the president tweeted: “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. We need more Justices or we will lose our 2nd. Amendment & everything else. Vote Trump 2020!”

Do you get the impression that the Supreme Court doesn’t like me?

— Donald J. Trump (@realDonaldTrump) June 18, 2020

Roberts noted that the administration gets a “do-over” and could still move to end DACA legally.”We do not decide whether DACA or its rescission are sound policies. ‘The wisdom’ of those decisions ‘is none of our concern.’ We address only whether the agency complied with the procedural requirement that it provide a reasoned explanation for its action. Here the agency failed to consider the conspicuous issues of whether to retain forbearance and what if anything to do about the hardship to DACA recipients,” he writes.Roberts, a conservative who sometimes sides with the liberal justices in cases with major political consequences for the nation and the court, was joined in the opinion by Justices Ruth Bader Ginsburg, Stephen Breyer and Elena Kagan. Justice Sonia Sotomayor joined the majority in all but one part, and filed an opinion as well.Justice Clarence Thomas also filed an opinion, concurring and dissenting in part, joined by Justices Samuel Alito and Neil Gorsuch. Additionally, Justice Brett Kavanaugh filed an opinion concurring and dissenting in part.DACA was introduced by President Barack Obama in 2012 and allows young people who were brought to the U.S. illegally as children to stay in the country and work without being deported on a two-year, renewable term. As of March 31, 2020, 640,000 people have active DACA status, and since 2012, more than 825,000 people have utilized the program.

Eight years ago this week, we protected young people who were raised as part of our American family from deportation. Today, I'm happy for them, their families, and all of us. We may look different and come from everywhere, but what makes us American are our shared ideals…

— Barack Obama (@BarackObama) June 18, 2020

“Eight years ago this week, we protected young people who were raised as part of our American family from deportation. Today, I’m happy for them, their families, and all of us. We may look different and come from everywhere, but what makes us American are our shared ideals,” Obama wrote on Twitter in response to the decision.The former president went on to call for the election of Joe Biden “and a Democratic Congress that does its job, protects DREAMers, and finally creates a system that’s truly worthy of this nation of immigrants once and for all.”Trump made DACA and immigration a central campaign issue when he ran for president starting in 2015. Over the course of his campaign, Trump specifically targeted Mexican people, infamously referring to Mexicans who come to the United States as “criminals, drug dealers [and] rapists.”Sotomayor quoted that line in her opinion, in which she took issue with the majority opinion finding that Trump’s decision to end DACA was not “motivated by animus.””But the impact of the policy decision must be viewed in the context of the President’s public statements on and off the campaign trail,” Sotomayor argues. “At the motion-to-dismiss stage, I would not so readily dismiss the allegation that an executive decision disproportionately harms the same racial group that the President branded as less desirable mere months earlier.”Copyright © 2020, ABC Audio. All rights reserved.