MONTGOMERY COUNTY, Pa. (CBS) — A former state cop who pleaded guilty to accidentally shooting and killing his pregnant wife in 2014 while she sorted baby clothes in the living room of their Montgomery County home is sentenced to three to 23 months in prison.

Joseph Miller, 37, broke down in tears, swallowing back sobs as he told the court that — when he shot 34-year-old Joanna Miller in the head – he not only lost his wife but also his best friend.

READ MORE: Frankford High School Unveils New Solar Training Lab For Students

It happened in their East Norriton home in 2014. Miller told investigators he was about to clean his gun when it accidentally went off. Charges were filed three years later.

ALSO READ: Police: 2 Brothers Killed In Southwest Philadelphia Double Shooting

READ MORE: Upper Dublin Carnival Raises Money For Those Affected By Ida

Prosecutor Steven Latzer argued for prison time citing the need to demonstrate that there are consequences for deadly behavior.

“His conduct was unbelievably negligent and reckless,” Latzer said.

Defense attorney Tim Wooward said, “Joe is a stand-up guy who only feels the pain and remorse of having taken – accidentally taken his wife’s life and that of his unborn child.”

MORE NEWS: Sixers Fall To Brooklyn Nets In Home Opener As Ben Simmons Saga Continues

The victim’s family testified at his sentencing, and said prison time won’t bring her back, but community service and having Miller speak on gun safety could have an impact on society.