Updated

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.

Dobyns' house also was burned down in 2008 with his wife and children sleeping inside -- his family escaped unharmed. In the case, Dobyns said the ATF accused him of starting the fire. The arsonist was never caught.

"It is evident that ATF officials failed to follow through in implementing the steps that were supposed to minimize the risks that might affect Agent Dobyns and his family. In the court's view, this represented another instance in which ATF violated the covenant of good faith and fair dealing," Allegra wrote in his opinion.

A 2007 settlement, reached after Dobyns first claimed the agency improperly investigated and protected his family against threats, awarded him $373,000.

But Dobyns alleged a "breach of good faith," claiming the agency continued to retaliate against him. Allegra, in his opinion, awarded Dobyns $173,000 in damages.

Dobyns, who is currently out of the country at a motivational speaking event, posted a lengthy statement on his website claiming vindication.

"This was never about a cash-out to leverage me into silence. This always was, has been, and will continue to be about the restoration of dignity that the federal government stole from me," he wrote.

Alfred Regnery, chairman of the Law Enforcement Legal Defense Fund which helped Dobyns, said in a statement that the decision "is just one step in restoring Mr. Dobyns' reputation" but also "an unfortunate reminder of the deplorable treatment of law enforcement agents ... under the Obama administration."

Asked for comment on Tuesday, a Justice Department official told Fox News: "We have received and are reviewing the Court's decision.  We have no further comment at this time."

The ATF managers involved in the case happen to be the same senior officials in Arizona who mishandled the Operation Fast and Furious case -- the botched anti-gunrunning sting -- including Agent in Charge Bill Newell and his assistant George Gillett.

The opinion said Gillett and another agent "purposely slowed" the probe into Dobyns' house fire and said despite Gillett's claims that he did not view Dobyns as a suspect, "every indication was that he did." The judge also said "there is strong indication" that Gillett at least "tacitly approved" of a decision to tape-record conversations with Dobyns in 2008 without his knowledge.

Allegra wrote that "it appears that ASAC Gillett purposely attempted to shield critical investigative information from senior ATF officials and did so, knowing full well that he was not complying with the procedures used for filing information."

Allegra likened the case to the Franz Kafka novel, "The Trial," where "Kafka depicts a totalitarian state in which the government suppressed freedom via a deluge of circuitous and irrational process," including acquittals that don't really remove the threat of legal charges.

"Experiences like these unfortunately bring to mind those that Agent Dobyns experienced," he wrote.  "A time that should have been one of healing and reconciliation, but that instead gave certain ATF officials and agents the opportunity to harm Agent Dobyns further. In the court's view, the actions of these ATF employees indisputably breached the covenant of good faith and fair dealing. ... Hopefully, this will bring this Kafkaesque story to an end."

Dobyns recently retired from the agency with his badge and full pension and is now on the speaking circuit.

Other agents expressed disappointment with Tuesday's decision and said the relatively modest award will discourage whistleblowers and wronged agents from coming forward with information about the agency.

Dobyns, a decorated agent, best-selling author and former star football player at the University of Arizona, joined ATF out of college. During his first week on the job at age 26, Dobyns was shot. He fell in love with undercover work, and was asked to infiltrate the Hells Angels.

Shaving his head, getting "fully sleeved" with tattoos shoulder to wrist, bulking up and essentially leaving his family behind, Dobyns became Jay "Bird" Davis, a chain-smoking, Harley-riding renegade.

Dobyns was invited to join the gang only after "killing" the leader of a rival gang, the Mongols. In fact, the shooting death was staged, complete with a Hollywood make-up artist and a dead cow used to splatter the victims' clothing with blood and brain matter.

Allegra, in his decision, also denied government claims for royalties from Dobyns' book.