A Casper man was sentenced Monday to a three- to five-year prison term for crimes related to smoking spice -- the synthetic drug that mimics marijuana -- and showing pornography to two girls.

Christopher Weir was originally charged with two felony counts of child endangering and other counts including third-degree sexual assault last year. Five of those counts were dismissed as part of a plea agreement, according to court records.

Weir's wife told investigators that her now ex-husband would act weirdly sexual around children when he smoked spice, according to court documents.

Weir also had prior felony convictions, according to court documents.

His attorney, Dylan Rosalez, told Natrona County District Court Judge Daniel Forgey that Weir has struggled with mental health and substance abuse issues.

Rosalez and Assistant District Attorney Kevin Taheri proposed, and Forgey accepted, the plea agreement that would require Weir to serve a three- to five-year sentence for the first child endangerment count plus a suspended consecutive three- to five-year sentence for the second count.

Weir also will be on five years supervised probation with terms including no alcohol or controlled substances without a prescription, and absolutely no contact with the underage victims.