No criminal charge will be filed against a San Jose police officer whose 3-year-old son accidentally shot and killed himself while handling his father's pistol in the family's Gilroy home, prosecutors said Tuesday.

Officer Brandon Orlando, a nine-year veteran, did not act in a grossly negligent manner, Santa Clara County District Attorney Jeff Rosen said in clearing the officer of criminal liability for the July 5 death of his son, Preston. Prosecutors could have charged Orlando with failing to properly store the weapon when children were present.

The boy found his father's backup Glock semiautomatic handgun in a nightstand drawer in the master bedroom and shot himself in the head, authorities said.

The officer thought his children wouldn't arrive home until after he had left with his weapons, Rosen said. Preston and his 5-year-old sister, however, arrived at the Kentwood Court home with their mother while Orlando was still there. The boy died in the upstairs master bedroom while Orlando was downstairs doing laundry.

The law requires that prosecutors consider the impact of a death while weighing whether charges should be filed, Rosen said.

Orlando has been devastated by his son's death and suffers flashbacks and has trouble sleeping, authorities said. In the moments after the shooting, his wife yelled at him, "This is all your f- fault," to which Orlando responded, "I know," authorities said.

The fact that Orlando had taken firearms training courses as a police officer was considered, said Deputy District Attorney Terry Harman, adding however that the officer did not get special treatment.

"Absolutely not," Harman said. "What matters are the facts and circumstances surrounding Preston's death, not the occupation of his father."