In a major victory for criminal justice reform, New York became the first state in the country on Monday to establish an independent commission with the power to investigate misconduct by state prosecutors.

Passed with bipartisan support and signed by Governor Andrew Cuomo, the legislation will create an 11-member state-wide commission, which will field complaints and launch its own investigations into wrongdoing committed by the state's 62 county district attorneys. The body's findings will be made public and referred to the governor, who has the power to remove district attorneys.

"Our criminal justice system must fairly convict the guilty and exonerate the innocent," Cuomo said in a statement. "When any prosecutor consciously disregards that fundamental duty, communities suffer and lose faith in the system, and they must have a forum to be heard and seek justice."

The legislation has been lauded by public defenders, criminal justice reform advocates, and New Yorkers who have been wrongfully convicted. According to the National Registry of Exonerations, the state has overturned 267 convictions of innocent people since 1989—the second highest total in the country, after Texas. Nearly two-thirds of those prosecutions involved "official misconduct."

Still, district attorneys guilty of misconduct almost never face consequences. In one high-profile case, Brooklyn prosecutor Michael Vechhione was found to have withheld key evidence in the wrongful murder conviction of Jabbar Collins, who spent 16 years in prison before he was released in 2010. Though a federal judge called Vechhione's actions "shameful," the career prosecutor never faced any discipline or sanctions, and retired with benefits five years ago.

"While most prosecutors respect their ethical obligations, far too many innocent people have been wrongly convicted as a result of prosecutorial misconduct, and until today there was no effective means for holding those who commit bad acts accountable," Rebecca Brown, Policy Director of the Innocence Project, said in a statement. "We hope other states will follow New York’s lead and address this serious problem plaguing the criminal justice system."

District attorneys, meanwhile, are decrying the legislation, and promising to mount a challenge in court before the law is enacted. "It is unfathomable that lawmakers would author and pass a bill that has numerous constitutional flaws and violates the separation of powers," said David Soares, President of the District Attorneys Association of New York. "It is outrageous that the Governor would sign such a bill."

As written, the legislation may be unlikely to survive judicial review, according to a memo sent by Attorney General Barbara Underwood’s office last week. There are concerns about a provision that would allow the legislative branch to name a majority of the commission's members, potentially in violation of separation of power clause, as well as the fact that private information handed over to the commission by prosecutors could be made public.

But Cuomo's signing of the bill was contingent on certain updates to the legislation once lawmakers return to Albany next year. The commission is expected to be formed in January once those changes are made.

Also on Tuesday, the governor announced a pardon of Harveys Gomez, a 39-year-old Bronx man set set to be deported over a drug sale charge from 2009. Gomez will be the 34th person pardoned during Cuomo's governorship—the majority of whom have been immigrants facing deportation under President Trump. The executive action is not guaranteed to keep a person in the country.