The Supreme Court appeared divided along predictable ideological lines Monday when considering whether an asylum seeker who failed his initial screening has a constitutional right to judicial review.

During the argument, conservative justices were concerned over what a government lawyer said would be a “flood” of such requests, frustrating Congress’s intention of subjecting those found quickly after crossing the border to expedited removal if their claims were unwarranted.

The court’s liberals seemed worried about giving such power to administration officials without some check on whether they are following the rules.

A person seeking asylum is advancing “the best kind of claim you can make to stay in this country, which is that if we turn you back, you’ll be subject to torture or persecution,” said Justice Elena Kagan. Why should he not be able to have a court review “a pretty basic question: Did the executive officer follow the rules that he was supposed to follow?”

But Deputy Solicitor General Edwin S. Kneedler said it is for Congress to determine the rules in the “limited and focused context” of a person who has entered the country illegally and, “nonetheless, is asking for basically mercy.”

The case involves Vijayakumar Thuraissigiam, who fled Sri Lanka in 2016 and was arrested in 2017 about 25 yards north of the Mexican border in San Ysidro, Calif. He was placed on track for expedited removal. That system, which dates to 1996, allows U.S. officials to quickly remove those 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 that 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.

Because Thuraissigiam had made it to the United States, American Civil Liberties Union lawyer Lee Gelernt told the justices that his client had the constitutional right to challenge his detainment by the government.

“This court has never before allowed the elimination of judicial review over the legality of deportations,” Gelernt told the justices. He added: “The political branches undoubtedly have enormous power in the immigration area, but the one thing it cannot do, and this court has never allowed them to do, is remove a check on themselves.”

But Justice Samuel A. Alito Jr. said the traditional habeas corpus right — the right to challenge government detention — does not exist in this case.

“Your client really doesn’t want to be released,” Alito said. “The government could take him to the airport, give him a ticket and say, you are released, and he could leave. That’s not what he wants. And the fundamental point of habeas is to secure release from what’s claimed to be unlawful executive custody.”

Gelernt replied: “He would be thrilled to just be outright released and have the order vacate. … Then he would be in this country, and he would apply for asylum affirmatively.”

Justice Brett M. Kavanaugh suggested Gelernt had gone too far when he said judicial review could be required for those who had only made it to ports of entry to the United States.

“You are saying a non-citizen who arrives at a port of entry, has never been in the United States, not lawfully admitted to the United States, nonetheless has a right under the U.S. Constitution to judicial review of the executive’s decision to say they’re not admissible?” Kavanaugh asked.

Gelernt said yes, but that it would be more limited than what Kavanaugh seemed to imply.

“I think the people who come here and don’t have asylum claims or those type of claims that are clearly inadmissible are not going to file habeas petitions,” he said. “No one’s going to file them because there’s not going to be a ground to stay here.”

The case is Department of Homeland Security v. Thuraissigiam.