A Cook County judge is giving the Chicago Police Department until the end of the year to turn over nearly five decades’ worth of previously unreleased files related to allegations of misconduct by officers.

The order was issued Friday in a Freedom of Information Act lawsuit filed against the city by Charles Green, who served more than two decades in prison after being convicted in a quadruple murder on the West Side in the 1980s.

In 2015, six years after his release, Green filed a FOIA request with the city asking for copies of any and all closed complaint register files from 1967 to 2015. The request was made, Green’s attorney said, “in order to help him discover evidence of his innocence and to preserve and disseminate evidence of innocence to others wrongfully convicted.”

Judge Alison Conlon ordered the CPD to produce all files to Green by the end of 2020, noting that the CPD had “willfully and intentionally failed to comply” with the Illinois Freedom of Information Act.

Jared Kosoglad, Green’s attorney, said the files would be published to the Invisible Institute’s website on a rolling basis. The Invisible Institute had previously published the names of officers accused of misconduct, as well as a brief description of the allegations and if any discipline was taken.

“We are evaluating the court’s decision and considering options for next steps,” a city Law Department spokesman said in an email.

Conlon’s order will likely provide the clearest look to date at alleged misconduct by Chicago police officers and how those cases are investigated and adjudicated.

“The order threatens to expose decades of police corruption and other skeletons out of CPD’s closet, prevents the City from continuing to expend millions in taxpayer dollars to keep police misconduct secret, and makes patterns of police misconduct readily available to the public, which will inform the ongoing public debate over how to police the police,” Kosoglad said in a statement.

Martin Preib, second vice president of the Fraternal Order of Police, said in an email to the Sun-Times that the judge’s ruling was “Great news for the Loevy lapdog media like you,” a reference to Loevy & Loevy, a civil rights law firm that often draws the ire of the police union.