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.

WRONGFULLY CONVICTED MAN WALKS FREE AFTER MORE THAN 2 DECADES AS PODCAST SHED LIGHT ON HIS MURDER CASE

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 attorney, Nick Brustin, said in a statement.

Ruben Martinez

Ruben Martinez Jr., right, speaks to the press at the Hall of Justice in Los Angeles, Tuesday, Nov. 12, 2019. (AP Photo/Brian Melley, File)

The Los Angeles City Attorney’s office declined to 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.

CLICK HERE TO GET THE FOX NEWS APP

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