WASHINGTON — When Bruce E. Ivins, an Army microbiologist, took a fatal overdose of Tylenol in 2008, the government declared that he had been responsible for the anthrax letter attacks of 2001, which killed five people and set off a nationwide panic, and closed the case.

Now, a former senior F.B.I. agent who ran the anthrax investigation for four years says that the bureau gathered “a staggering amount of exculpatory evidence” regarding Dr. Ivins that remains secret. The former agent, Richard L. Lambert, who spent 24 years at the F.B.I., says he believes it is possible that Dr. Ivins was the anthrax mailer, but he does not think prosecutors could have convicted him had he lived to face criminal charges.

In a lawsuit filed in federal court in Tennessee last Thursday, Mr. Lambert accused the bureau of trying “to railroad the prosecution of Ivins” and, after his suicide, creating “an elaborate perception management campaign” to bolster its claim that he was guilty. Mr. Lambert’s lawsuit accuses the bureau and the Justice Department of forcing his dismissal from a job as senior counterintelligence officer at the Energy Department’s lab in Oak Ridge, Tenn., in retaliation for his dissent on the anthrax case.

The anthrax letters were mailed to United States senators and news organizations in the weeks after the Sept. 11, 2001, terrorist attacks, causing a huge and costly disruption in the postal system and the federal government. Members of Congress and Supreme Court justices were forced from their offices while technicians in biohazard suits cleaned up the lethal anthrax powder. Decontamination costs nationwide exceeded $1 billion. At least 17 people were sickened, in addition to the five who died.