MISSOULA – A Missoula man exonerated on a 2002 rape conviction sued Missoula County and a dozen current or former law-enforcement officials for damages Thursday, accusing them of botching the initial investigation and wrongly prosecuting him.

The lawsuit filed by Cody Marble in state District Court in Missoula says sheriff’s deputies and prosecutors fabricated evidence or ignored evidence that would have exonerated him, leading to his November 2002 conviction for raping a fellow inmate in the Missoula County Juvenile Detention Center.

Marble, 34, has said from the outset that the crime never happened and that fellow inmates made up the incident to frame him.

“(County officials) failed to properly investigate the weight of the juvenile accusers’ allegations … against Marble because they were operating under a preconception of Marble’s guilt, by conducting a predetermined, result-certain orientated investigation against Marble,” the lawsuit said.

The suit seeks compensatory and punitive damages for Marble, saying he spent years of his life behind bars for a crime he never committed and suffers from continued emotional distress, depression and post-traumatic stress disorder.

County officials couldn’t immediately be reached for comment Thursday evening.

Marble was sentenced to 20 years for the crime and spent more than 14 years attempting to overturn his conviction. He was freed from prison in 2016 and finally exonerated in early 2017, after Missoula County Attorney Kirsten Pabst filed to dismiss the rape charge against him.

Pabst’s office reinvestigated the case after a 2015 Montana Supreme Court ruling said a new standard should be applied to Marble’s evidence of alleged innocence. She said the investigation convinced her that the crime had not been committed.

“I firmly stand by my decision that the charges against Cody Marble must be dropped,” she said in court filings in May 2016. “It may not be popular, but it’s the right thing to do.”

Marble’s lawsuit names Missoula County, the county attorney’s office and the county sheriff’s office as defendants. It also singles out former County Attorney Fred Van Valkenburg, four prosecutors involved with the case, former Sheriff Mike McMeekin and deputies who conducted the investigation. It does not name Pabst as a defendant.

Marble was 17 when he was an inmate in the juvenile detention center in early 2002, incarcerated there after being arrested when he ran away from a treatment program in the Flathead Valley.

Five days after his father bailed him out from jail in March 2002, county authorities arrested him on charges that he had raped a fellow 13-year-old inmate the previous week, in the shower area of the jail.

A fellow inmate initially reported the alleged rape to a detention officer after Marble had been released. Missoula County then deputies interviewed other inmates before arresting Marble, the lawsuit said.

The suit said investigating deputies ignored inconsistencies in the stories of the inmates and failed to interview guards on duty the night of alleged rape.

“Had they interviewed the four highly trained detention officers on duty the evening of the fabricated story, they would have learned that the detention officers would have been able to observe the alleged crime, which they did not,” the suit said.

The suit also said that prosecutors didn’t tell Marble or his defense lawyer about the conflicting statements or other evidence that might have shown his innocence.

“(They) decided to disregard Marble’s unalienable right to life, liberty and pursuit of happiness by charging him and trying to convince him that he was guilty for a felony sex crime that never occurred,” the suit said.