CHICAGO (CBS) –Records of misconduct against Chicago Police officers must be preserved, the Illinois Supreme Court ruled Thursday, dealing a setback to the police union, which wanted them destroyed.

The justices voted 6-1 against the police union. The court found that destroying the documents would violate that state’s public records law.

“In light of the plain language of the Local Records Act, we agree with the City that the statutory framework the General Assembly constructed makes clear that Illinois recognizes a public policy favoring the proper retention of government records,” the court said.

The city had argued that state law requires CPD to keep the records intact, but the Chicago Fraternal Order of Police argued their contract with the city required records older than five years to be destroyed.

While parties are generally free to make their own contracts, this court has long held that when a conflict exists between a contract provision and state law, as it clearly does in this case, state law prevails,” Justice Lloyd Karmeier wrote in the court’s ruling.

Mayor Lori Lightfoot called the high court’s ruling “entirely the right decision.”

“For way too long we have not been as transparent as we need to be in this city. We have to have accountability and legitimacy, and that can’t come if we hide from the public documents that underscore what has happened with disciplinary investigations and records in our city, and I think the Supreme Court made entirely the right decision,” she said. “We must maintain those records, and we must be transparent about what’s in them.”

An FOP representative did not immediately comment on the ruling, saying the union was reviewing the court’s decision.

The union’s attorney earlier had argued their lawsuit seeking to destroy some misconduct records was about following the terms of the union’s collective bargaining contract with the city, which allows for personnel records to be destroyed after five years. The attorney said there are even provisions in the contract that allow the city to preserve those records if needed. He argued the city needs to abide by the contract.

Critics of that effort said destroying misconduct records would only protect officers with troubling backgrounds.

Grief continues for families of people killed by Chicago Police officers – in many cases wrongfully.

“We need to stop this,” said University of Chicago law professor and civil rights attorney Craig Futterman.

People fighting for police reform, such as Futterman, said officer backgrounds and misconduct records are key to tracking and firing problem cops – especially in the wake of George Floyd’s death in Minneapolis and subsequent protests.

But as we first told you in January, the Fraternal Order of Police wants all misconduct records destroyed after five years. They pushed the case all the way to the Illinois Supreme Court.

“Tomorrow, if there’s an order that says, ‘Bring on the great bonfire of records, all that evidence abuse – all that ability to actually address ongoing practices of abuse – will go up in smoke,” Futterman said.

Futterman, along with the Invisible Institute’s Jamie Kalven, fought to have police misconduct records made public – and won.

The FOP sued the city in 2014 in an effort to block CPD from releasing the records. A Cook County judge granted the FOP an injunction later that year, prohibiting the city from releasing the records, but in 2016 an Illinois Appellate Court panel overturned that ruling, ordering the city to release the records under the Freedom of Information Act.

“It was a battle,” Kalven said. “It was close to 10 years of litigation.”

Since the Illinois Supreme Court agreed to hear the case, the FOP’s leadership has changed.

“What I’ve seen is a doubling down on resistance, denial,” Futterman said of the FOP now.

Futterman argued officers’ misconduct records would also help the Police Department comply with the federal consent decree that was imposed on it. Losing the records, he said, would be a blow to the community, the department, and the city.

“These records belong to all the people of Chicago,” Futterman said. “We need them.”