In a 7-2 decision, the court said the Sri Lankan asylum seeker -- Vijayakumar Thuraissigiam -- is ineligible to challenge his deportation under both federal law and the Constitution.
"Habeas has traditionally been a means to secure release from unlawful detention, but respondent invokes the writ to achieve an entirely different end, namely, to obtain additional administrative review of his asylum claim and ultimately to obtain authorization to stay in this country," Justice Samuel Alito writes in the majority opinion, joined by the court's four other conservatives.
"Respondent attempted to enter the country illegally and was apprehended just 25 yards from the border. He therefore has no entitlement to procedural rights other than those afforded by statute," Alito added.
The ruling is a boost for Trump, who has tried to crack down on a flood of asylum cases in the legal system, on the heels of two high-profile losses at the court last week in cases on LGBTQ rights and DACA.
"Today's decision ensures that expedited removal, a vital tool for combating illegal immigration, will remain expeditious," said acting Secretary of Homeland Security Chad Wolf in a statement to ABC News. "This ruling was a victory for law and order and the American public."
Immigrant advocates saw the decision as a major setback for the thousands of migrants seeking refuge in the U.S. and those hoping for a second chance after having their claims rejected.
"This ruling fails to live up to the Constitution's bedrock principle that individuals deprived of their liberty have their day in court, and this includes asylum seekers," said ACLU attorney Lee Gelernt, who argued before the court on behalf of the Sri Lankan man. "This decision means that some people facing flawed deportation orders can be forcibly removed with no judicial oversight, putting their lives in grave danger."
Justices Stephen Breyer and Ruth Bader Ginsburg concurred with the majority judgement, but emphasized that it should be narrowly focused on this case.
"We need not, and should not, go further," Breyer wrote. "We need not go further because the Government asked us to decide, and we agreed to review, an issue limited to the case before us."
At the heart of the case is the 1996 Illegal Immigration Reform and Immigrant Responsibility Act, which established the system for regulating asylum applications and streamlining the process of removing immigrants with meritless claims.
"It was Congress's judgment that detaining all asylum seekers until the full-blown removal process is completed would place an unacceptable burden on our immigration system and that releasing them would present an undue risk that they would fail to appear for removal proceedings," Alito wrote.
The majority of asylum seekers over the last five years, 77%, have had their claims of "credible fear" approved, Alito noted.
In dissent, Justices Sonia Sotomayor and Elena Kagan, who were most critical of the administration during oral arguments, said judicial oversight of asylum cases is constitutional and necessary.
"Today's decision handcuffs the Judiciary's ability to perform its constitutional duty to safeguard individual liberty and dismantles a critical component of the separation of powers," Sotomayor wrote. "It will leave significant exercises of executive discretion unchecked in the very circumstance where the writ's protections have been strongest. And it increases the risk of erroneous immigration decisions that contravene governing statutes and treaties."
The ruling comes just days before the traditional end of the Supreme Court term on June 30. Thirteen decisions are still pending, including decisions on abortion, tax credits for religious schools, the Affordable Care Act, Electoral College and subpoenas for President Trump's financial records.