President Donald Trump answers questions from reporters as he meets with Romania's President Klaus Iohannis in the Oval Office of the White House in Washington, August 20, 2019.

President Donald Trump on Thursday filed a lawsuit against Manhattan District Attorney Cyrus Vance Jr. and his longtime accounting firm, days after news broke that the prosecutor had subpoenaed years of Trump's personal and corporate tax returns.

In a filing in U.S. District Court in lower Manhattan, Trump's attorneys argue that the president shouldn't have to give up his closely guarded tax returns because "virtually all legal commenters agree that a sitting President of the United States is not subject to the criminal process while he is in office."

Vance's office had issued a subpoena last month to accounting firm Mazars. The firm said in a statement issued Monday that it "will respect the legal process and fully comply with its legal obligations."

"We have received the plaintiff's complaint and will respond as appropriate in court," said Vance spokesman Danny Frost. "We will have no further comment as this process unfolds in court."

Trump's attorney, Jay Sekulow, said in a statement that the suit had been filed "in order to address the significant constitutional issues at stake in this case."

"We are in court to protect the President's rights and the Constitution," Marc Mukasey, another lawyer for Trump, told CNBC.

The parties in the case are set to appear next Wednesday in court before federal Judge Victor Marrero.

The suit marks the latest attempt by Trump to take legal action against prosecutors and lawmakers who have attempted to acquire tax documents that Trump has avoided publicly disclosing since his presidential campaign. Modern presidential candidates have shared years of their tax returns with the public while on the campaign trail.