WASHINGTON — In a victory for the Trump administration, the Supreme Court ruled Thursday that immigrants whose requests for asylum were rejected in bare-bone summary proceedings may not contest the denials in federal court. The case, which concerns the fundamental question of who is entitled to seek habeas corpus, will affect thousands of asylum-seekers.

The vote was 7-2. Justices Sonia Sotomayor and Elena Kagan dissented.

The case concerned Vijayakumar Thuraissigiam, a member of Sri Lanka’s Tamil ethnic minority who was apprehended about 25 yards north of the Mexican border near San Ysidro, California.

He sought asylum, saying he would face a credible fear of persecution if he were returned to Sri Lanka. His request was considered under “expedited removal” procedures called for by a 1996 law that streamlined asylum applications from people caught near the border and barred courts from reviewing most aspects of the determinations made under the procedures.

Thuraissigiam, a farmer, told an asylum officer that he had been savagely beaten in Sri Lanka by men who had blindfolded and abducted him. He said he had spent 11 days in a hospital recovering from his injuries.

Though their communication was imperfect, an asylum officer believed Thuraissigiam. But the officer rejected his request because Thuraissigiam could not identify the assailants or definitively establish their motives.

Thuraissigiam filed a petition for a writ of habeas corpus in federal court, noting what had happened to him was consistent with documented instances of abuses directed against Tamils in Sri Lanka. A trial judge rejected the petition, saying it was barred by the 1996 law.

But a three-judge panel of the 9th U.S. Circuit Court of Appeals, in San Francisco, ruled the law unconstitutional, saying that it violated the Constitution’s suspension clause. The clause says that “the privilege of the writ of habeas corpus shall not be suspended, unless when in cases of rebellion or invasion the public safety may require it.”

The case, Department of Homeland Security v. Thuraissigiam, No. 19-161, was argued in early March and was among the last ones the justices heard in person, before they stopped taking the bench because of concerns about the coronavirus. Lawyers for the two sides disagreed about the effect of a ruling allowing judicial review.

Thuraissigiam’s lawyer, Lee Gelernt of the American Civil Liberties Union, said habeas petitions from asylum-seekers would be rare. In the year since the 9th Circuit had allowed them, he said, only about 30 of more than 9,000 immigrants denied asylum had filed such petitions.

Edwin S. Kneedler, a lawyer for the federal government, said there was good reason to expect a flood of habeas petitions if the Supreme Court affirmed the 9th Circuit’s ruling.