The U.S. government has agreed to pay $2.5 million to the family of a tabloid photo editor who died in the 2001 anthrax attacks, resolving a long-running lawsuit in which family members had accused the government of negligence.

In documents filed Monday in U.S. District Court in West Palm Beach, Fla., the Justice Department agreed to the settlement but did not admit liability in the death of Robert Stevens. Stevens, an employee of American Media, publisher of the National Enquirer and other tabloids, was exposed to the anthrax spores and died Oct. 5, 2001.

He was the first victim of the spore-laden letters sent to news media and two U.S. Senate offices in late 2001 that killed five people, sickened 17 and triggered a massive FBI investigation. The Justice Department concluded last year that a deceased Fort Detrick scientist, Bruce E. Ivins, had single-handedly prepared and mailed the anthrax spores, terrorizing the nation just after the Sept. 11, 2001, attacks. Some have doubted Ivins’s guilt.

In a $50 million lawsuit, Stevens’s widow, Maureen, his son and two daughters accused the government of negligence in his death because it engaged in the “ultra-hazardous activity” of experimenting with anthrax bacteria at Fort Detrick. Officials knew “that the potential harm was likely to be great, namely, the cause of human death,’’ according to the lawsuit, filed in 2003.

The Justice Department had sought to dismiss the case on various grounds, arguing in a 2004 filing that Stevens “died at the hands of a killer.’’ It is unclear why the two sides agreed to settle and why the case took so long to resolve.

Court documents said that a tentative agreement had been reached by late October and that Justice Department officials then approved it. The settlement does not require the approval of a federal judge.

A Justice Department spokesman declined to comment Tuesday. An attorney for Stevens’s relatives, Richard Schuler, said the family is “very satisfied and happy that the case is concluded” but still blames the government for Stevens’s death.

“I think the settlement was a recognition by the government that it did not have adequate security” at the Ft. Detrick lab, Schuler said.

The agreement is the second major settlement stemming from the anthrax case. In 2008, the Justice Department agreed to pay $5.8 million to settle an invasion-of-privacy lawsuit filed by former Fort Detrick researcher Steven J. Hatfill, who had been the subject of a lengthy and ultimately fruitless FBI probe stemming from the attacks.

In the Stevens lawsuit, Schuler, had accused the government of “stonewalling” in a 2008 interview and expressed anger that it took so long for Ivins to have been fingered as the anthrax killer.

On Tuesday, he said that Maureen Stevens still wears her husband’s wedding ring around her neck, and keeps his voice on the answering machine.

“She hasn’t really gotten over his death,” Schuler said.