WASHINGTON – In the weeks leading up to the federal government’s takeover of Fannie Mae and Freddie Mac, dozens of top lawyers worked to figure out the best way to save the two Washington-area mortgage giants.

The in-house teams at the U.S. Department of the Treasury and the Federal Housing Finance Agency, which is now the conservator for the two companies, were dealing with lawyers from at least nine private firms: Cleary Gottlieb Steen & Hamilton; Wachtell, Lipton, Rosen & Katz; Covington & Burling; Cadwalader Wickersham & Taft; Arnold & Porter; Davis Polk & Wardwell; Cravath, Swaine & Moore; and McGuireWoods. Representing Fannie Mae at the table was Sullivan & Cromwell chairman H. Rodgin Cohen.