WASHINGTON ― Two days before President-elect Donald Trump takes office, the Obama administration did him a big favor by telling the Supreme Court it would be best to insulate high-ranking Bush-era officials who stand accused of unconstitutional conduct in the aftermath of the Sept. 11 attacks.

How the justices decide the long-running case, Ziglar v. Abbasi, could have profound implications for the incoming administration, whose soon-to-be chief executive clinched the presidency on promises that he’d mass-deport millions of undocumented immigrants, ban Muslims from entering the country and bring back torture for terrorism suspects.

“There’s no blank check, even for the president,” Justice Stephen Breyer said during Wednesday’s hourlong hearing in the case, a dispute over whether courts can adjudicate constitutional violations by federal officials. “And if there’s no blank check, that means sometimes they can go too far. And if they have gone too far, it is our job to say that.”

President Barack Obama’s two appointees, Justices Sonia Sotomayor and Elena Kagan, were not in the courtroom. Both women are recused from the case, presumably due to their prior roles as appellate judge and solicitor general for Obama, respectively.

Acting Solicitor General Ian Gershengorn, delivering the last oral argument of the Obama years on Wednesday, defended the policies of the Bush administration in the chaotic weeks and months after Sept. 11, 2001, under which more than 700 non-citizens of Arab or Muslim descent were profiled, rounded up and detained for several months as terror suspects — despite a later Department of Justice report that found that none of them had any ties to terrorism.

Joe Raedle via Getty Images Protesters gather in front of the U.S. Supreme Court to mark 15 years since the first prisoners were brought to the U.S. detention facility in Guantanamo Bay, Cuba, on Jan. 11, 2017.

Gershengorn argued that these lists of suspects were “facially valid constitutional policies,” and that a group of former detainees who sued former Attorney General John Ashcroft, former FBI director Robert Mueller and other top officials over their deployment have no legal recourse against them in the courts.

“You know from day one that many of them have nothing to do with terrorists,” said Justice Ruth Bader Ginsburg, “and yet you allow that system that might have been justified in October [2001] to persist for months and months when these people are being held in the worst possible conditions of confinement.”

From police officers to Secret Service agents, the Supreme Court has been reluctant to allow lawsuits against government officials, even if plaintiffs can make a strong case that they violated the Constitution.

But the court has made some concessions.

“Part of the policy that we’ve announced is that we don’t want people forming policy to have to worry about they’re going to have to pay if the policy is found infirm,” Chief Justice John Roberts told Rachel Meeropol, the New York lawyer representing the detainees.

Congress has never passed a law to hold accountable federal officials who violate people’s constitutional rights. But in 1971, the Supreme Court ruled in Bivens v. Six Unknown Federal Narcotics Agents that the Constitution opens the courthouse door to lawsuits over these violations. In the decades since, the justices have been very cautious about expanding that right to sue — a detail that was not lost on some of the justices this week.

“I think you’re asking us to go further,” Justice Anthony Kennedy told Meeropol. “I think what you’re asking for is a legitimate argument with many valid points to it, but you’re asking for us to create a new Bivens cause of action.”

The lawyer responded that expanding that right would be “appropriate” in light of how her clients have been treated.

There’s no blank check, even for the president. Justice Stephen Breyer

“The core of our complaint is that there was no sensitive national security judgments being exercised. No one was being vetted. No one was determined to be a threat,” Meeropol said.

In its own report, the Justice Department found that the detainees were held in solitary confinement for 23 hours a day, strip-searched and given only meager necessities in terms of hygiene and food, among other forms of mistreatment.

Breyer, striking a pragmatic tone, said he could “understand” why government officials, in the aftermath of the Sept. 11 attacks, would be quick to “pick up anybody you might think is connected, and we’ll worry about the rest of it later.”

But he suggested that completely foreclosing the possibility to even sue and develop a record about these issues — which include the unwarranted detention of suspects for up to eight months ― might be a bridge too far.

“I mean, that’s what’s worrying me a lot. And why doesn’t that at least state an allegation?” he said. “Suppose it had been five years. Suppose it had been 10 years.”

When all is said and done, the Supreme Court could very well decide that there’s no room under its Bivens doctrine to bring these claims against the highest reaches of the federal government — a result that, for better or for worse, could be a boon to the next administration, and any other after it.

“If individuals who are the subject of clearly unconstitutional national security policy don’t even have the opportunity to get into the court, then there is nothing to deter even more excessive exercises of government power in the future,” Meeropol warned at the close of her argument.

With only six of its members on the case, the Supreme Court is expected to rule in Ziglar v. Abbasi before the end of June.