Washington (CNN) President Donald Trump lost an appeal Monday to keep his tax returns from a Manhattan grand jury, setting up a potential Supreme Court challenge.

A three-judge panel for the Second Circuit Court of Appeals said "presidential immunity does not bar a state grand jury from issuing a subpoena in aid of its investigation of potential crimes committed by persons within its jurisdiction, even if that investigation may in some way implicate the president."

The court also noted that "the only question before us is whether a state may lawfully demand production by a third party of the President's personal financial records for use in a grand jury investigation while the President is in office." The judges added that "we hold that any presidential immunity from state criminal process does not bar the enforcement of a subpoena."

Trump sued the Manhattan District Attorney's office to block a subpoena it sent to his long time accounting firm Mazars USA seeking eight years of tax returns. Attorneys for Trump argued a President is immune from criminal investigations, a claim the district judge dismissed. Trump then appealed that decision.

The appeals court ruling gives a green light, in theory, for investigators to obtain the President's tax returns, but Trump's attorney Jay Sekulow said the President will continue his appeal.

Read More