Later, Judge Denny Chin posed the Fifth Avenue hypothetical to William S. Consovoy , a lawyer for Mr. Trump, and asked for his view.

“Local authorities couldn’t investigate? They couldn’t do anything about it?” Judge Chin asked, adding: “Nothing could be done? That’s your position?”

“That is correct. That is correct,” Mr. Consovoy said.

The panel did not immediately indicate when it would issue a ruling, but Judge Robert A. Katzmann , the appeals court’s chief judge, signaled that he and the other judges understood both the gravity of the matter and that they were unlikely to have the final word.

“This case seems bound for the Supreme Court,” Judge Katzmann said early in the arguments, adding later, as the hearing wrapped up, “We have the feeling that you may be seeing each other again in Washington.”

A deal struck with the district attorney’s office will allow the president time to seek a speedy review of the appellate ruling in the Supreme Court on the condition that he ask that the court hear the case in its current term, which ends in June.