The Federal Housing Finance Agency and the Treasury Department have reached an agreement that will allow Fannie Mae [s:FNMA] and Freddie Mac [s:FMCC] to keep their earnings for the foreseeable future, until they reach the capital targets needed to exit conservatorship. The agreement was solidified through amendments to the preferred stock purchase agreements held by Treasury. Last year, the two agencies reached an agreement to let the mortgage giants retain up to $25 billion in earnings. Prior to that, all of Fannie and Freddie's earnings were swept to the Treasury Department to repay the federal government for the funds used to bail the two enterprises out. FHFA Director Mark Calabria warned that retained earnings would not be enough to recapitalize Fannie and Freddie, and that without access to private capital they were still at risk of failing in a future housing crisis.