(FOXNEWS) — A federal judge on Tuesday gave another black eye to the Bureau of Alcohol, Tobacco, Firearms and Explosives, issuing a scathing rebuke of the agency’s handling of the career and security of one of its own — celebrated undercover agent Jay Dobyns, who infiltrated the notorious Hells Angels.

After a costly six-year legal battle, Judge Francis Allegra, with the federal claims court in Washington, D.C., chastised the ATF for failing to adequately protect Dobyns and his family from the gang.

The motorcycle gang had sought retribution after the agent’s undercover work during Operation Black Biscuit, which brought 16 indictments against them including charges of murder and racketeering.

Threats against Dobyns included threats to kill him and his family, gang-rape his wife, and infect Dobyns with the HIV virus.

Note: Read our discussion guidelines before commenting.