President Trump filed a lawsuit against his own accounting firm, Mazars USA, and Manhattan District Attorney Cyrus Vance in federal court on Thursday in an effort to prevent the release of his tax returns.

The lawsuit, filed in Manhattan federal court and obtained by Fox News, was in response to Vance’s move to subpoena Mazars for eight years of the president’s personal and corporate tax returns as part of an investigation into potential campaign finance violations.

“In response to the subpoenas issued by the New York County District Attorney, we have filed a lawsuit this morning in Federal Court on behalf of the President in order to address the significant constitutional issues at stake in this case,” Trump attorney Jay Sekulow told Fox News Thursday.

The filing by Trump's legal team claims the subpoena for his tax returns are "unconstitutional" while the president is in office. It also asks the court to order a "permanent injunction staying the subpoena while the president is in office." Trump's lawyers also claimed that Vance was running a "harassment" campaign against the president.

Trump attorney Marc Mukasey told Fox News that "We are in court to protect the President's rights and the Constitution."

Vance has until the close of business Monday to file a response to Trump's motion for a temporary restraining order, and Trump's legal team must reply by the end of the day Tuesday. Both sides are scheduled to appear for oral arguments Wednesday morning. In the meantime, Vance has agreed "to stay enforcement of and compliance with the subpoena" issued to Mazars LLP.

“We are pleased that the constitutional issues at stake in this case will receive the appropriate review from the District Court," Trump's legal team told Fox News.

Thursday's developments came after Mazars chief marketing officer Jennifer Farrington told Fox News Monday that they had “received a subpoena” as part of Vance’s investigation, but would not provide further details.

In a statement, Mazars said the firm will “respect the legal process and fully comply with its legal obligations.”

The firm added: “We believe strongly in the ethical and professional rules and regulations that govern our industry, our work and our client interactions. As a matter of firm policy and professional rules, we do not comment on the work we conduct for our clients.”

The subpoenas to Mazars were reportedly issued late last month after the district attorney’s office opened a criminal investigation into the role that the president and The Trump Organization played in hush-money payments ahead of the 2016 presidential election.

Former Trump personal attorney Michael Cohen orchestrated a payment of $130,000 to adult film actress Stormy Daniels, who said she had a sexual encounter with the president in 2006, in the weeks prior to the election. The president had reimbursed Cohen for the money paid, but denied the alleged affair, saying that the payments were personal matters, not campaign expenses.

Cohen pleaded guilty last year to campaign finance violations, tax evasion, and other crimes and is currently serving a three-year sentence in federal prison.

In a separate case, the president sued the House Ways and Means Committee and New York state officials in July for employing an "unconstitutional" law to obtain his state tax returns, after the Treasury Department's move to block his federal records from release.

TRUMP SUES HOUSE WAYS AND MEANS COMMITTEE, NEW YORK STATE OFFICIALS TO PROTECT HIS TAX RETURNS

The suit was filed by the president, "in his capacity as a private citizen," in Washington D.C. federal court against the committee, New York State Attorney General Letitia James and commissioner of the New York State Department of Taxation and Finance Michael Schmidt.

That lawsuit came after the committee chairman, Richard Neal, D-Mass., earlier this month sued the Trump administration, accusing officials of violating federal law by refusing to comply with the panel's requests and subpoenas for the documents.

Days later, New York Gov. Andrew Cuomo signed a bill into law, titled the TRUST Act, which would allow lawmakers on Capitol Hill to obtain Trump’s state tax returns. Under previous law, however, state tax returns were required to remain private with an exception for law enforcement.

CLICK HERE TO GET THE FOX NEWS APP

The president’s lawsuit in July also claimed that the new law was "unconstitutional" and “violates the First Amendment,” saying it was enacted “to discriminate and retaliate against President Trump for his speech and politics.”

The filing also claimed that the new law was part of “a larger campaign in New York to uncover and expose the President’s private financial information in the hopes of damaging him politically.”

Fox News' John Roberts and Marta Dhanis contributed to this report.