Baltimore prosecutors have spent more than a year reviewing thousands of arrests by the rogue Gun Trace Task Force and are preparing to ask the courts to throw out nearly 800 tainted cases.

The Office of State’s Attorney Marilyn Mosby found these cases — mostly older ones in which the defendants already have been released from prison — to be compromised by the crooked cops. Officials plan to begin vacating convictions next month.

Deputy State’s Attorney Janice Bledsoe discussed the plans Thursday during a meeting of the state courts’ rules committee.

Bledsoe has been poring over cases in which the eight indicted cops and others they implicated acted as the arresting officers, served as material witnesses or handled evidence of the crime. Initially, prosecutors estimated thousands of cases might be compromised. In many of those cases, prosecutors were able to verify the compromised officers’ work through other witnesses.

Eight former members of the Gun Trace Task Force were convicted of racketeering beginning in 2017 and sentenced to federal prison. Some officers admitted to crimes as far back as 2008. They are serving prison sentences that range from seven to 25 years. The officers — six accepted plea deals; two were convicted at trial — stole money from citizens, lied on paperwork and bilked the city for unearned overtime pay.

The sweeping corruption scandal further eroded the public’s trust in the Baltimore Police. The scandal also left city leaders bracing for a raft of lawsuits filed by victimized residents. More than 60 people already filed notice they intend to sue. Hundreds more may be waiting.

City attorneys, meanwhile, have gone to the courts to try and ensure taxpayers won’t be on the hook for damages. Last year, Mosby appealed to state lawmakers for authority to vacate the old convictions. She has said judges had denied motions in some cases on grounds that there was no legal basis for a prosecutor to make such a request. Mosby had argued that this procedural requirement had hamstrung efforts to right the wrongs of the Gun Trace Task Force.

Del. Erek Barron, a Prince George’s County Democrat who is a former state and federal prosecutor, sponsored a bill to empower prosecutors.

“I applaud Delegate Erek Barron and the hard work of my Policy and Legislative Affairs team for securing legislation which will allow us to finally right nearly 800 cases impacted by the wrongful and illegal acts of the Gun Trace Task Force,” Mosby said in a statement Thursday.

The Maryland General Assembly passed the bill last session. The law takes effect next month.