The initial $187.5 billion loan remains outstanding, however, because of the deal’s structure.

Watching these profits pour into the Treasury, shareholders cried foul. Contending the sweep was unjust, one of those with large stakes in both Fannie and Freddie securities — the Fairholme Fund — sued the government in July 2013. From the outset, the government demanded extreme secrecy in the case. Lawyers at the Justice Department secured confidential treatment of almost all the 150,000 pages of documents submitted by the Treasury and F.H.F.A. by late January. Even the plaintiff bringing the case is barred from viewing these documents; only its lawyers can see them.

The government has also fought every discovery request made by the Fannie and Freddie shareholder. Officials at the Treasury and F.H.F.A. claim that disclosure of documents relating to their actions would destabilize the economy and financial markets and raise mortgage rates.

Really? The documents the judge has ordered the government to produce were created three to seven years ago. How could they unsettle the markets now?

Even more intriguing, though, is the Justice Department’s broad assertions that 669 of the documents it must produce are subject to various privileges and not to be disclosed. The government even claimed that privileges applied to documents it had not yet reviewed, court records show.

According to previously undisclosed logs filed as part of the case, most of the documents are said to be covered by attorney-client privilege or deliberative process privilege, which protects intragovernment communications before a final decision is made in a matter.

But the government has invoked presidential privilege on 45 documents created either by officials at the Treasury or the F.H.F.A., the regulator charged with conserving Fannie and Freddie’s assets and stabilizing the institutions “with the objective of returning the entities to normal business operations,” as its website states.

The privilege logs, which are not confidential and were obtained by The New York Times, offer clues about what the government does not want revealed.