Credit Suisse will pay about $651 million to Fannie and $234 million to Freddie, said the Federal Housing Finance Agency, the conservator of the two companies rescued by government during the 2008 financial crisis.
The FHFA said the settlement resolves all of its claims in two lawsuits against Credit Suisse.
The claims alleged that Credit Suisse misrepresented the quality of billions of dollars of mortgage-backed securities it sold to Freddie and Fannie during 2005-2007.
Credit Suisse agreed to the settlement while still "vigorously" denying the allegations in both cases.
The agency said the bank's documentation for the securities contained misstatements and omissions of material facts concerning the quality of the underlying mortgage loans, the creditworthiness of the borrowers, and the practices used to originate such loans.
During the years-long housing bubble, banks' loose lending practices extended sub-prime mortgages to borrowers with patchy credit and at-risk finances. Those borrowers began to default on the loans, spurring the subprime crisis that collapsed the bubble and led to the 2008 financial crisis.
"As a result of defendants' misstatements and omissions of material fact, Fannie Mae and Freddie Mac have suffered substantial losses as the value of their holdings has significantly deteriorated," the suit said.
The FHFA was created in 2008 to oversee the government's conservatorship of Fannie and Freddie, which back most of the mortgages financed in the United States.
The settlement marks the latest big government settlement with a US banking giant in the aftermath of the housing bust.
Since the beginning of the year, the FHFA has announced $2.26 billion in settlements, including the latest with Credit Suisse. Wall Street bank Morgan Stanley paid $1.25 billion and French bank Societe Generale paid $122 million in February.
For all of 2013, the FHFA recovered nearly $8 billion on behalf of taxpayers through such settlements. FHFA sued 18 financial institutions in 2011 alleging securities law violations, and in some cases, fraud, in relation to their marketing of mortgage backed securities.
Credit Suisse said Friday it would take an after-tax charge of 275 million Swiss francs ($311.6 million) on its 2013 financial results.
"This agreement resolves Credit Suisse's largest mortgage-related investor litigation," the Zurich-based bank said in a statement.
Credit Suisse is also one of 14 Swiss banks under US investigation for allegedly accepting tens of billions of undeclared dollars from US citizens trying to avoid taxes.
A former banker of Credit Suisse pleaded guilty on March 12 to the charge.
Andreas Bachmann, a Swiss citizen, admitted that between 1994 and 2006 he engaged in a "wide-ranging" conspiracy to defraud US tax officials, the Justice Department said.