Dr. Hatfill’s lawsuit, filed in 2003, accused F.B.I. agents and Justice Department officials involved in the criminal investigation of the anthrax mailings of leaking information about him to the news media in violation of the Privacy Act. In order to prove their case, his lawyers took depositions from key F.B.I. investigators, senior officials and a number of reporters who had covered the investigation.

Mark Grannis, a lawyer for Dr. Hatfill, said his client was pleased with the settlement.

“The good news is that we still live in a country where a guy who’s been horribly abused can go to a judge and say ‘I need your help,’ and maybe it takes a while, but he gets justice,” Mr. Grannis said.

The settlement, Mr. Grannis said, “means that Steven Hatfill is finally an ex-person of interest.”

In a written statement, Mr. Grannis and Dr. Hatfill’s other lawyers said, “We can only hope that the individuals and institutions involved are sufficiently chastened by this episode to deter similar destruction of private citizens in the future  and that we will all read anonymously sourced news reports with a great deal more skepticism.”

The lawyers will take their fee out of the settlement, which will pay out $5.8 million over 20 years. The $4.6 million figure is the cost of the annuity to the government.

The settlement called new attention to the fact that nearly seven years after the toxic letters were mailed, killing five people and sickening at least 17 others, the case has not been solved.