The Supreme Court ruled Thursday that asylum seekers who are quickly turned down by U.S. immigration officials do not have a right to make their case in federal court, a win for the Trump administration and its desire to rapidly deport people who enter the United States illegally.

The ruling was 7 to 2, although the usual undercurrents of an ideological divide on the court were present. Two of the court’s liberals dissented, and the other two agreed only with the outcome in the specific case.

Justice Samuel A. Alito Jr., writing for the majority, rejected a lower court’s ruling that the Constitution guarantees a “meaningful opportunity” for asylum seekers to make their case to a judge if they are turned down in an initial screening.

Alito said the system set up by Congress weeds out “patently meritless claims” and provides for quickly removing those making them. Most pass their initial screening, he noted, but those who do not have no additional recourse.

At argument, the government said that allowing judicial review would prompt a “flood” of requests and place additional burdens on an immigration system already under strain.

The case involves Vijayakumar Thuraissigiam, who fled Sri Lanka in 2016 and was detained in 2017 about 25 yards north of the Mexican border in San Ysidro within San Diego. He was placed on a track for expedited removal.

That system, which Congress created by overwhelming majorities in 1996, allows U.S. officials to quickly remove people who have just crossed the border illegally, but it has an exception for those seeking asylum.

Thuraissigiam, a farmer and a member of Sri Lanka’s Tamil minority, described being beaten by strangers in his home country. But an official said he did not establish a credible case that he was persecuted.

Thuraissigiam went to federal court, where a district judge said the law did not entitle him to review. But the U.S. Court of Appeals for the 9th Circuit disagreed.

Alito was joined in the opinion by Chief Justice John G. Roberts Jr. and Justices Clarence Thomas, Neil M. Gorsuch and Brett M. Kavanaugh.

Alito focused on the historical meaning of the constitutional right to challenge detention, called habeas corpus. He said what Thuraissigiam was asking for was something quite different: the ability to stay in this country.

He also said for those picked up immediately after entering illegally, there is no entitlement to due process. He said it was enough that Congress provided for an initial screening, a review of that decision by a supervisor and a review by an immigration judge.

Justice Stephen G. Breyer, joined by Justice Ruth Bader Ginsburg, agreed with the court that Thuraissigiam’s claims were too vague to make a credible case for asylum. But they said there was no need for the court to make additional pronouncements that would seal off the courts from others who might have stronger cases.

Justice Sonia Sotomayor wrote a toughly worded dissent, which was joined by Justice Elena Kagan.

“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, adding that “our constitutional protections should not hinge on the vicissitudes of the political climate or bend to accommodate burdens on the judiciary.”

Thuraissigiam’s lawyer, Lee Gelernt of the American Civil Liberties Union, said in a statement that the decision might affect tens of thousands of people “facing flawed deportation orders [who] can be forcibly removed with no judicial oversight, putting their lives in grave danger.”

The Trump administration, by sharply restricting migrants’ access to courts and asylum protections, has made it significantly more difficult for asylum seekers to apply for humanitarian protections and gain release.

The record surge of Central American families and children across the U.S. border with Mexico in 2018 and 2019 was driven by migrants claiming a fear of persecution or grave harm if they were sent back to Guatemala, Honduras and El Salvador, nations with some of the world’s highest homicide rates.

In its decision, the court noted that fear claims have increased 1,883 percent over the past decade, exacerbating a backlog of more than 1 million pending cases in U.S. immigration courts. As the U.S. asylum system became more dysfunctional and the court backlog worsened, smuggling organizations in Central America began transporting large numbers of migrants and coaching them to claim fear of harm to avoid detention and deportation.

“Today’s decision allows the Trump Administration to continue to defend our borders, uphold the rule of law, and keep Americans safe,” Justice Department spokeswoman Alexa Vance said in a statement.

Before the pandemic, border crossers who stated a fear of harm were returned to Mexico to wait outside U.S. territory for their court dates, under a program called the Migrant Protection Protocols, or they could be flown to Guatemala and directed to apply for asylum there.

Thursday’s decision was a win for Homeland Security officials seeking to expand the number of deportations using the expedited removal fast-track tool.

The ruling follows a decision by the U.S. Court of Appeals for the District of Columbia Circuit allowing Homeland Security to expand the use of expedited removal procedures nationwide — not only in border areas — for migrants detained within two years of crossing into the United States.

Muzaffar Chishti, a senior fellow at the Migration Policy Institute, a Washington think tank, said Thursday’s ruling on asylum was not surprising because “almost all circuit courts” have ruled differently from the 9th.

Also significant, he said, was the Trump administration’s regulatory change this week requiring asylum seekers with pending cases to wait a full year to obtain work authorization.

Applicants who file claims for protection typically have been allowed to work legally, so they can support themselves while awaiting a decision, and the latest Trump move runs counter to the way asylum systems around the world function, Chishti said.

“The message is: We are going to make your life as miserable as we can, if you even think about applying for asylum,” he said.

The case is Department of Homeland Security v. Thuraissigiam.