New York’s prosecutors sued Gov. Cuomo and the state Legislature Wednesday to toss out a new law to probe accusations of prosecutorial misconduct.

The lawsuit filed by the NYS District Attorney’s Association in Albany Supreme Court claims the creation of the Commission of Prosecutorial Conduct violates the separation of powers doctrine.

“Specifically, the state: impermissibly interferes with the constitutionally protected independence and core functions of elected District Attorney by granting the CPC general oversight and disciplinary authority over the exercise of prosecutor discretion,” the court papers claim.

The suit claims the law illegally authorizes the Court of Appeals to suspend district attorneys and perform “non-judicial” tasks and the commission itself — made up of executive, legislative and judicial appointees — would perform duties administrative duties that run afoul of the constitution.

“If the law is allowed to stand, the independence of the District Attorneys will be threatened, the role of the judiciary impermissibly altered, the performance of law enforcement duties chilled, due process an equal protection rights violated, the entitlement of voters to a District Attorney responsive to their needs undermined, and the integrity of our constitutional system compromised,” the suit said.

The commission will be modeled after an existing panel that oversees judicial misconduct.

New York City also has a civilian complaint review board that reviews claims of police misconduct.

The controversial measure passed the Democratic-run Assembly and the Republican-led Senate in June and approved by Cuomo in August over the objections of prosecutors.

But Cuomo said his signature on the bill was contingent on an amendment next year to fix some of the objections raised by prosecutors.

Still, the governor’s office Wednesday defended the law.

“We believe in a fair and equal justice system that places no one above the law and ensures officers of the court are held accountable to upholding this fundamental standard. While we haven’t been served with any lawsuit, we are confident this bipartisan and groundbreaking agreement will withstand legal challenge,” said Cuomo spokesman Tyrone Stevens.