EASTSOUND, Wash. (AP) — A man convicted of sexual misconduct involving an Orcas Island High School student but whose case was later thrown out has filed a lawsuit against the San Juan County Sheriff’s Office.

The Seattle Times reported Monday that Gerald Grellet-Tinner claims in his lawsuit that he was wrongly convicted because of a conspiracy involving a former detective who had a secret sexual relationship with the alleged victim.

Grellet-Tinner was accused of having sex with an Orcas Island High School student in 2015.

A judge threw out the case after an investigation revealed a relationship between the detective and alleged victim.

The detective was not prosecuted and resigned from the sheriff’s office.

San Juan County Prosecutor Randy Gaylord says he has not seen the lawsuit and could not comment.