HARRISBURG, Pa. — A former officer in the Pennsylvania National Guard has been sentenced to prison for soliciting sex from a person he believed to be a 14-year-old girl.

Fifty-one-year-old Joseph Witmer, of Hummelstown, was sentenced Monday to two to four years in prison. He had pleaded no contest to charges including unlawful conduct with a minor.

Investigators say Witmer sent sexually explicit messages to an undercover investigator posing as a teen girl. He was arrested when he showed up to meet with the fake teen.

Witmer was a chief warrant officer at Fort Indiantown Gap when he was arrested in March 2017. He is no longer with the National Guard.