Updated

An Arizona man who was arrested, transported cross-country and jailed for a robbery that he didn't commit filed a lawsuit Thursday against the Iowa county and prosecutor responsible for charging him.

Joseph McBride, 23, spent two months in custody after authorities arrested him at his Phoenix apartment on Aug. 24. McBride was among three people charged for a Jan. 1, 2017, home invasion in his former hometown of Cedar Rapids, Iowa — even though he had proof he was 1,500 miles (2415 kilometers) away and investigators never spoke with him before his arrest.

McBride's lawsuit details a shoddy investigation by the Cedar Rapids Police Department that implicated McBride based on the mentally ill victim's "own investigation," which relied on Facebook photos. It alleges that the complaint signed by Linn County Attorney Jerry Vander Sanden falsely contended the victim "positively identified" McBride as a suspect and that police had "phone records and social media" suggesting he conspired with the other two suspects.

McBride, who works at an Arizona dog treats factory, is seeking compensatory and punitive damages for violations of his constitutional rights.

Vander Sanden said Thursday the charging decision was based on a "good-faith belief that the victim was correct in the identification" of McBride and that prosecutors acted promptly to release him when his alibi checked out.

The case stems from the robbery of 27-year-old Tristan Hermanson, who told police that an acquaintance he knew as Elizabeth came to his apartment before two men forced their way in, beat him with a handgun, and stole money and his cellphone. Hermanson, who suffered facial injuries, soon identified the woman as 22-year-old Elizabeth Navarro and said she set him up.

Hermanson, who is bipolar, told police days later that he "had done his own investigation" and believed the men involved were Navarro's boyfriend, Austin Foster, and a man whose Facebook account called him "Jody Holliday." Investigators found "Jody Holliday" didn't exist but used photos and the birthdate to link the account to McBride, a 2013 graduate of Cedar Rapids Washington High School. They were unsuccessful in finding him in Cedar Rapids, apparently unaware he had moved to Phoenix in November 2015. They obtained Navarro's phone records, which showed communications with Foster and another man around the time of the robbery but no connection to McBride.

The county attorney charged Navarro, Foster and McBride with first-degree robbery, which carries up to 25 years in prison. The complaints alleged Navarro "appeared to have collaborated with Foster and McBride to coordinate the robbery." McBride's lawsuit calls that a "materially and recklessly false statement," saying his only link to Navarro was that they were Facebook friends.

McBride was jailed in Phoenix on $50,000 cash-only bond before being transported to Iowa on a private prison van that stopped at jails in Nevada, Colorado and Missouri. Even before he arrived in Cedar Rapids on Sept. 19, he insisted he was innocent and had cellphone photos proving he was in Glendale, Arizona, hours before the robbery.

McBride's attorney filed notice of the alibi defense Oct. 9, providing names and contact information of witnesses. One attested that he celebrated New Year's Eve with McBride in Phoenix and spent the next day with him rearranging a storage unit.

The charge against McBride was dropped on Oct. 31, a day after Navarro identified another man as the third suspect. That man hasn't been charged.

McBride's attorney, Tom Frerichs, declined comment on the damages he's seeking. He recently negotiated a $285,000 settlement with another Iowa county for a client who spent 16 days in jail for a crime he didn't commit.