A federal judge in New York City ruled Monday that President Donald Trump must hand over years of tax filings and other financial documents to Manhattan prosecutors.

Judge Victor Marrero’s denied arguments by President Trump attorneys, who argued as president, he is both immune from both criminal prosecution and being criminally investigated by a state prosecutor.

“As the court reads it, presidential immunity would stretch to cover every phase of criminal proceedings, including investigations, grand jury proceedings and subpoenas, indictment, prosecution, arrest, trial, conviction, and incarceration,” Marrero wrote. “That constitutional protection presumably would encompass any conduct, at any time, in any forum, whether federal or state, and whether the President acted alone or in concert with other individuals.”

The judge said he “cannot endorse such a categorical and limitless assertion of presidential immunity from judicial process as being countenanced by the nation’s constitutional plan, especially in the light of the fundamental concerns over excessive arrogation of power that animated the Constitution’s delicate structure and its calibrated balance of authority among the three branches of the national government, as well as between the federal and state authorities.”

The returns had been sought by Manhattan District Attorney Cyrus R. Vance Jr. His office is investigating the Trump Organization’s involvement in buying the silence of two women who claimed to have had affairs with the president. In August, the Manhattan district attorney’s office issued a grand jury subpoena to the president’s accounting firm, Mazars USA, for the president’s tax filings and other financial documents.

President Trump’s lawyers have said the investigation is politically motivated and that the quest for his tax records from January 2011 to the present should be stopped because he is immune from any criminal probe as long as he is president.

The president’s legal time immediately appealed the ruling and was granted a temporary stay of enforcement of a grand jury subpoena by the U.S. Circuit Court for the Second Circuit.

President Trump took to social media to blast Marrero’s decision, accusing Democrats and Manhattan prosecutors of political retribution.

“The Radical Left Democrats have failed on all fronts, so now they are pushing local New York City and State Democrat prosecutors to go get President Trump. A thing like this has never happened to any President before. Not even close!” he wrote.

The Radical Left Democrats have failed on all fronts, so now they are pushing local New York City and State Democrat prosecutors to go get President Trump. A thing like this has never happened to any President before. Not even close! — Donald J. Trump (@realDonaldTrump) October 7, 2019

In a statement to NBC, President Trump’s personal lawyer Jay Sekulow said: “We are very pleased that the Second Circuit Court of Appeals has issued a stay of the subpoena issued by New York District Attorney Cy Vance.”

The Associated Press contributed to this report.