US mortgage finance giant Fannie Mae on Tuesday posted record annual net income of $17.2 billion for 2012, compared with a net loss of $16.9 billion a year earlier. The massive swing into profit was due to a decline in serious loan delinquency rates, an increase in home prices and a settlement with Bank of America, the government-rescued company said in a statement. "Solid business fundamentals such as improving performance of our book of business and improvements in the housing market led us to report the largest annual and quarterly net income in the company's history," said Susan McFarland, executive vice president and chief financial officer. For the fourth quarter, the Washington-based company posted net income of $7.6 billion, up from $1.8 billion in the third quarter and compared with a loss of $2.4 billion in the year-ago period. "The company expects to remain profitable for the foreseeable future," it said. Fannie Mae, seized by the government in a bailout during the 2008 financial crisis, said it had paid US taxpayers $11.6 billion in dividends in 2012, bringing total dividends paid to $35.6 billion since its rescue. The 2012 earnings included $1.3 billion in pre-tax income from a settlement with Bank of America over risky mortgages it purchased during the housing bubble. Fannie Mae and sibling lender Freddie Mac were rescued by the government from the brink of bankruptcy in September 2008 amid surging loan losses after home prices collapsed. The government took control of the two mortgage finance giants in the $180 billion bailout. Freddie Mac on March 1 also reported a large swing into annual profit for 2012 amid growing signs of a housing market recovery.