EAST NORRITON, Pa. (CBS) — A former state cop pleads guilty to shooting and killing his pregnant wife in 2014, while she sorted baby clothes in the living room of their Montgomery County home three years ago.

Joseph Miller, 36, pleaded guilty to two counts of involuntary manslaughter. One count for his wife, Joanna Miller, who was six months pregnant when she was shot in the head. The second count for the child who died after an emergency cesarean section.

It happened March 7, 2014, but Miller wasn’t charged until earlier this year.

Miller was painting a room in the East Norriton home, preparing for the birth of their third child. His wife was in the living room sorting baby clothes.

Once done painting, Miller told police he got his gun and went into the living room to tell his wife he was going to the backyard shed to clean it.

Miller initially claimed he was 8 to 10 feet away from his wife when the firearm accidentally went off. He changed that to 2 to 4 feet. But charges were filed as prosecutors say additional testing showed the gun was 3 to 6 inches from her head when it was fired.

Miller was a seven-year veteran of the State Police. He was off-duty at the time of the shooting.

The couple’s two children are heard in the background of the 9-1-1 call.

Miller faces a maximum of 5 to 10 years in prison when he is sentenced at a later date.