GLEN ROCK -- A veteran borough police officer will reportedly spend three years in prison after admitting to sexting two teenage girls, and illegally selling guns the police department had seized.

Eric Reamy, 52, a 27-year member of the Glen Rock Police Department, was sentenced to three years in jail, the result of a plea deal he agreed to earlier this year, NorthJersey.com reported Friday. Before agreeing to the deal, Reamy was facing 15 years in jail if convicted of the child endangerment and other charges levied against him, the report said.

The former police officer, who was a detective bureau supervisor, was first arrested in August of 2015 on charges he sent sexually-explicit text messages to two girls, ages 14 and 17, that he was investigating. Using his department-issued cell phone, Reamy sent the 14-year-old photos of his genitals, and convinced her to send him a topless photo of herself, authorities have said.

The next month, he was arrested on additional charges claiming he pawned guns to two local gun shops that had previously been surrendered to the police department.

Reamy, of Fair Lawn, pleaded guilty to charges related to both crimes in March of this year.

According to NorthJersey.com, family members Friday blamed the crimes on issues Reamy faced after battling colon cancer and being prescribed medication to help him deal with anxiety.

As a part of his sentencing, Reamy will also have to register as a sex offender, give up his ability to hold public employment, be on parole for life, and pay the victims' medical expenses, the report said.

Jessica Mazzola may be reached at jmazzola@njadvancemedia.com. Follow her on Twitter @JessMazzola. Find NJ.com on Facebook.