NEW YORK — I wasn’t expecting laughter in court today.

But at the Second Circuit Court of Appeals in Manhattan, there were stifled chortles as personal attorneys for President Trump finally arrived at the logical destination of their argument that he is immune not only from prosecution – but from investigation.

It came in Trump’s appeal challenging a state grand jury subpoena for financial records from his longtime accounting firm, Mazars USA.

Manhattan District Attorney General Counsel Carrey Dunne told the appeals court that Trump was acting as if the law did not apply to him, and was trying to have it both ways by asserting executive protections over an investigation that concerned his private business.

Trump attorney William Consovoy had argued that not only does the Constitution prevent a sitting president from indictment, but it also prevents criminal investigation or “process” from being applied to the head of state.

Dunne brought up Trump’s famous statement when he caught fire during the 2016 Republican primary, saying, “I could stand in the middle of 5th Avenue and shoot somebody and I wouldn’t lose any voters.”

“If he did pull out a handgun and shoot someone on Fifth Ave,” Dunne asked, “would the local police be restrained?”

“Would we have to wait for impeachment?” he added.

If the judges were moved by Dunne’s argument, it wasn’t immediately obvious. The trio – composed of Democrat-appointed Chief Judge Robert Katzmann, Judge Denny Chin, and Judge Christopher Droney – stayed typically stone-faced.

But when Consovoy retook the podium with his booming voice and somewhat bilious affect, fielding more questions from the court, he doubled down on his argument that congressional, federal, and state bodies are forbidden from investigating a sitting President.

Judge Chin raised Dunne’s point. He asked Consovoy for his “view on the Fifth Avenue example.”

“Local authorities couldn’t investigate, they couldn’t do anything about it?” he asked.

“No,” replied a visibly annoyed Consovoy amid stifled chortles.

“Nothing could be done? That’s your position?” Chin repeated.

“That is correct, that is correct,” Consovoy responded, before qualifying it by saying that a president could be prosecuted after leaving office. He also conceded that documents could be gathered in the course of such an investigation.

Earlier in the hearing, Judge Droney had asked Consovoy whether the arguments he made about Trump’s immunity from state-level investigation would also apply to a similar federal probe. To be clear, Vance did not subpoena Trump directly – rather, he issued a subpoena to a third-party holder of Trump’s financial records as part of an investigation into the Trump Organization.

But Consovoy said that the federal example was only slightly different, in part because “the attorney general exercises control over all” of the separate U.S. attorneys offices, as opposed to each individual state governing itself.

“That may not always be true,” Droney replied, apparently referring to the Southern District of New York’s recent activities.

Consovoy did not address that directly, but later lauded Manhattan federal prosecutors for their past treatment of Trump. He told the appeals court that previous probes had been “handled with sensitivity” appropriate to the office.

Droney had earlier asked Dunne what he would do if Trump contested the next subpoena his office was contemplating.

“Which subpoena?” Dunne replied.

“The one you’re probably thinking about right now,” Droney retorted, before Katzmann ended the exchange by noting that “this case seems bound for the Supreme Court.”