A federal court judge has denied President Trump's attempt to block the Manhattan District Attorney's subpoena for eight years of tax returns related to the president and the Trump Organization, officials said.

U.S. District Judge Victor Marrero on Monday dismissed Trump's lawsuit, which was filed on Sept. 19 and argued that the subpoena was unconstitutional because he was a sitting president.

At the end of August, Manhattan DA Cyrus Vance Jr., a Democrat, had subpoenaed Mazars USA, the accounting firm used by Trump and the Trump Organization, for eight years of tax returns for the president and the business. Vance's office explained that the subpoenas were issued as part of "an ongoing state criminal prosecution," according to court papers.

"Because the Mazars subpoena attempts to criminally investigate a sitting president, it is unconstitutional," court papers argue. "This court should declare it invalid and enjoin its enforcement until the president is no longer in office."

But Marrero saw things differently, court papers show.

"Consider the reach of the President's argument," Marrero wrote in his decision. "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. 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."