A Dallas man filed a federal civil rights lawsuit Friday against a female detective, alleging she falsely claimed that he had been picked out of a photograph line-up in a capital murder case.

Anderson Jones spent 17 days in jail before the charges were dropped. He could have faced the death penalty.

“The officer lied to a judge to get a warrant for Mr. Jones and the lie is that she indicated that Jones was picked out of a photo lineup as being the individual that committed the murder,” said Don Tittle, Jones’ attorney. “The problem is that he wasn’t. He was picked out of a one-photo lineup which, of course, is not a lineup at all.”

Tittle says his client wants Detective Elena Perez held accountable for her actions that led to Jones’ arrest last summer.

Internal investigators have sustained allegations that she failed to follow the department’s lineup policy and “entered inaccurate” information on the arrest warrant affidavit. She has not yet been disciplined.

Perez declined to comment through her attorney.

“Being charged with capital murder and then put away in jail for three weeks is certainly not an insignificant event and for something that had absolutely nothing to do with it,” Tittle said. “I think it’s understandable that he wants some accountability.”

News 8 was the first to report about the issues surrounding the lineup. The department said in a statement that the charges had been dismissed against the two men because detective “found inconsistencies in Miller’s statements and determined his explanation to be unreliable.”

The circumstances of this case were particularly troubling, given that police lineups have been blamed for many wrongful convictions nationwide and in Dallas County over the years.

Jones and Christopher Miller were arrested last summer in the robbery killing of a Subway sandwich shop employee Leonardo Ortega.

Ortega, 28, was shot and killed shortly before 11 p.m. in June 2015 as he and another employee were in the process of closing the Subway store at Wynnewood Shopping Center on Illinois Street in Oak Cliff.

According to police records, two robbers entered the store with their face and head covered while a third robber stood outside as the lookout. One suspect pointed a gun in the face of Ortega and the other employee, demanding money. The second suspect took cash from the register.

A struggle ensued and Ortega was fatally shot during that confrontation.

For weeks, police had little to go on. Friends and family posted fliers all over the area, appealing for help to find Ortega's killers.

Then — on July 20 — a tip came into Crime Stoppers about Christopher Miller being a possible suspect. Miller, who is mentally challenged, was interviewed by Perez on Aug. 1, 2015.

He told her that he was home at the time of the murder and he initially denied any involvement. The lawsuit filed by Jones allege that Perez coerced Miller into making a confession.

Police internal affairs records say Miller was shown a photo line-up by the department’s lineup team. He picked three different people out of the line-up. One of them was Jones.

Perez then showed Miller a picture of Jones violating the department’s line-up policy.

In an exclusive interview last year, Jones told News 8 that he was interrogated on and off for about 10 hours. He says he refused to confess to something he didn’t do. He provided her an alibi.

“They said someone had ID’d me and said I was the shooter and that I was going to jail for it. She was basically telling me that they had witnesses and that I was going to jail. I might as well cop a plea.”

Tittle says the detective waited days to confirm Jones’ alibi.

According to Perez's arrest warrant affidavit, Miller stated that Jones shot and killed Ortega, and had picked Jones out of a photo lineup.

Both men were then arrested on capital charges. A bond of $1 million was set on each.

The Dallas Police Department then announced a break in Ortega's killing on its DPD Beat blog, reporting they'd arrested Miller and Jones on capital murder charges.

The issue with the lineup came to light several days later when homicide sergeants Joseph Garza and Calvin Johnson approached Deputy Chief Rob Sherwin, saying they believed she had violated the department's lineup policy. That led to her transfer out of the homicide unit and the opening of an internal affairs investigation.

The department issued no such similar statement when they quietly allowed Miller and Jones to be released from jail.

Jones told News 8 that he was angry and hurt that his 6-year-old son saw his mugshot flash on the evening news.

"Part of my life was taken from me," Jones said. "Sitting there in jail for something I know I didn't do, and how easy it was for her to do it, and the fact that I know it carries the death penalty — so for me to die for something I didn't do, I can't swallow that."

Perez is currently assigned to the youth operations unit as a detective.

“The reality is this officer is still working for the department, can still go and testify to any criminal jury,” Tittle said. “Criminal juries can convict people, send them to prison, based on the word of that officer who has been found to have lied under oath. Now that shouldn’t happen.”