In the wake of the deadliest mass shooting in modern U.S. history and in the midst of a fierce national debate over gun control, a Pennsylvania federal judge has ruled that a former state trooper, who over a decade ago was involuntarily committed to a hospital for attempting suicide, can own firearms.

U.S. District Judge John E. Jones of the Middle District of Pennsylvania granted judgment in favor of Michael Keyes, a former U.S. Air Force veteran and retired master trooper with the Pennsylvania State Police who sued the federal government after the state courts rejected his bid to expunge his mental health record. Keyes argued that he was unable to own guns under federal law with the committal on his record, even though he was entrusted with a service pistol while on duty as a state trooper.