LOS ANGELES — The city of Los Angeles will pay $8 million to a man who spent 12 years in prison for a series of armed robberies he didn't commit, his lawyers announced.

The criminal case against Ruben Martinez Jr. was thrown out in 2019 after prosecutors agreed he had been wrongly convicted. Investigators tracked down alibi witnesses who said Martinez was at work when some of the crimes were committed between 2005 and 2007.

The settlement "recognizes not only the anguish Mr. Martinez and his family experienced throughout his wrongful imprisonment, but also the egregious police misconduct and missteps that came to light through discovery arising from the civil lawsuit," his attorneys said in a statement.

The Los Angeles Police Department and the city attorney's office didn't immediately respond to emails seeking comment on the settlement.

Martinez's first trial ended with a deadlocked jury. Two of the victims testified at that trial that Martinez was not the robber. Defense attorneys said those witnesses were not called by the prosecution or the defense in the subsequent trial that ended with a conviction and a sentence of more than 47 years.

In a statement provided Tuesday by his attorneys, Martinez said, "Today, we can finally right this wrong."