A Pennsylvania state trooper who fatally shot his pregnant wife on Friday afternoon in a small town was cleaning his gun at the time, police say.

Joseph Miller was taking apart his personal .45-caliber pistol at home in East Norriton, but he did not realize the gun was loaded, police said, according to The Philadelphia Inquirer. The gun discharged, shooting Miller's wife, JoAnne, 34, in the head.

JoAnne, who was 22 weeks pregnant at the time, was rushed to a local hospital, where she was pronounced dead. Her baby did not survive. The couple's other two children were home during the incident but were unharmed, the Inquirer notes.

Joseph Miller is a seven-year veteran of the force. Montgomery County detectives and local police are investigating the shooting, but no charges have been filed yet, NBC Philadelphia reports.

"There is some indication at this point that it was an accidental discharge of the gun," Montgomery County Assistant District Attorney Kevin Steele said, according to NBC Philadelphia. "But that's under investigation at this point. I can't go any further than that."