LOS ANGELES (AP) — An FBI agent from Phoenix has been indicted in Los Angeles on 18 charges that accuse him of having an affair with the wife of a man he was investigating.

Thirty-nine-year-old Joe Gordwin was arrested Thursday morning at the FBI office in Phoenix.

The indictment says over a three-year period Gordwin hid his relationship from his superiors and sought a favorable plea agreement for his lover's husband in connection with a robbery case.

Gordwin is charged with six counts of wire fraud, five counts of making false statements and seven counts of witness tampering. If convicted, he faces a maximum sentence of 285 years in prison