New York (CNN) Lawyers for Deutsche Bank and Capital One repeatedly refused Friday to tell an appellate court in New York whether the banks are in possession of President Donald Trump's tax returns, citing "contractual obligations" not to disclose the information and drawing the ire of a panel of judges.

The three-judge panel was so frustrated by the lawyers' refusal to answer that one of the judges suggested the appellate court might seek an order for the information.

"Should we go to court and seek an order? I'm serious. We need to know," US Circuit Judge Peter W. Hall told a lawyer for Deutsche Bank, Raphael Prober.

After several minutes of argument on the subject, the panel directed the lawyers to file letters under seal within 48 hours saying whether the banks have Trump's tax returns. But while the banks' lawyers indicated they would respond in writing, it wasn't clear that they agreed to provide that information.

The dispute came during oral arguments before the 2nd US Circuit Court of Appeals in Trump's appeal of a lower court ruling that rejected his attempt to block Democratic lawmakers from accessing his financial records through subpoenas of those banks.

Read More