DES MOINES, Iowa (AP) — An Arizona man who threatened to shoot Iowa lawmakers over his frustration with a failed attempt to change Iowa’s sex offender registry law has been sentenced to five years in prison.

Cody Leveke, also identified as Cody Meyers in court records, was sentenced Friday in Des Moines’ federal court, the Des Moines Register reported. Leveke was arrested in December 2019 and convicted by a jury in September of interstate communication of a threat.

Leveke sent emails to state Sen. Herman Quirmbach saying he was “angry enough to pull a mass shooting down at the State House,” and that the Second Amendment exists “so we can kill politicians” who don’t follow the law, prosecutors said. Leveke, who was convicted of a felony sex crime in Iowa as a teen, was angry over the failure of a bill that would have allowed him to apply to be removed from the Iowa sex offender registry without moving back to the state.

At his sentencing, Leveke reiterated that he did not believe his emails constituted legitimate threats and gave a lengthy speech arguing he was the victim of a wide array of criminal conduct by local and federal law enforcement in Iowa and Arizona.

U.S. District Judge John Jarvey sentenced Leveke to the maximum of five years, noting that Leveke sent the emails while on probation related to harassment charges in Arizona and that Leveke had shown “not one gram of remorse.”