President Donald Trump's legal team argued on Wednesday that if he shot someone in the middle of 5th Avenue in New York City, he would still be immune from criminal prosecution or investigation.

The comments came during a court hearing over New York state prosecutors' subpoena for eight years of Trump's tax returns as part of an investigation into whether the Trump Organization falsified business records.

Trump's lawyers have tried to nullify the subpoena, arguing that while he's in office, Trump cannot be investigated or prosecuted.

On Wednesday, Judge Denny Chin expressed skepticism toward that argument and referenced "the 5th Avenue example" Trump first brought up during the 2016 election.

Chin asked Trump's lawyer, William Consovoy, whether he was arguing that local authorities could not investigate Trump even in that case, and Consovoy replied, "That is correct."

Visit Business Insider's homepage for more stories.

President Donald Trump's lawyers argued on Wednesday that he could not be investigated or criminally prosecuted if he shot someone in the middle of 5th Avenue in New York City.

The comment, from attorney William Consovoy, came as part of a federal appeals court hearing around New York state prosecutors' attempts to obtain Trump's tax returns as part of an investigation into him.

Trump's lawyers have sought to block the subpoena from the Manhattan District Attorney's office on the broad and legally dubious claim that while he's in office, Trump is immune not just from criminal prosecution but from investigation as well.

Judge Denny Chin expressed skepticism toward that argument during Wednesday's hearing and alluded to a statement Trump made during the 2016 election, when he said that he could shoot someone on 5th Avenue and still not lose any supporters.

When Chin pressed Consovoy about the limits of presidential immunity and referenced "the 5th Avenue example," Consovoy argued that local law enforcement authorities could not investigate Trump even if he shot someone on 5th Avenue.

While Trump is in office, "nothing can be done, that's your position?" Chin asked Consovoy.

"That is correct, that is correct," Consovoy replied.

Read more: A federal judge ordered Trump to turn over 8 years of his tax returns to New York prosecutors

The case before the federal appeals court relates to the Manhattan district attorney's office investigation into whether the Trump Organization falsified business records connected to Trump's hush-money payments to two women who alleged affairs with him during the 2016 campaign.

As part of the investigation, state prosecutors subpoenaed Trump's accounting firm, Mazars USA, for his personal and corporate tax returns dating back to 2011.

Trump's legal team, in turn, sought to block the subpoena by arguing that a sitting president is immune from criminal investigation. The Justice Department joined Trump's team in trying to delay the subpoena.

Earlier this month, US District Judge Victor Marrero dismissed the countersuit, ruling that Trump's lawyers were making an "extraordinary" reach that was "repugnant to the nation's governmental structure and constitutional values."

Marrero wrote that Trump's argument implied "the constitutional dimensions of the presidential shield from judicial process are virtually limitless."

Until the president leaves office, "his exemption from criminal proceedings would extend not only to matters arising from the performance of the President's duties and functions in his official capacity, but also to ones arising from his private affairs, financial transactions, and all other conduct undertaken by him as an ordinary citizen both during and before his tenure in office," the ruling said.

On Wednesday, the three-judge appeals court panel pushed Trump's lawyers to explain how complying with the subpoena from the Manhattan district attorney's office would prevent the president from carrying out his official duties.

"The premise is that this is a distraction. It distracts the President from carrying out his duties," Chin said. "Where is the distraction if the subpoena is served on accountants? The President doesn't have to do anything to comply with the subpoenas."

The highly publicized case is likely going to make it to the Supreme Court. CNN reported that both sides struck a deal on Monday to fast-track any Supreme Court petitions after the appeals court comes to a decision, which means the public could get a window into Trump's closely held finances before the 2020 election.