Fannie Mae, the government-owned mortgage provider, reported a record $7.6 billion in quarterly earnings, its first annual profit since the housing bubble burst, according to documents filed Tuesday morning.

Just four years ago, the government had to step in and take control of Fannie Mae, which was brought down to its knees by deep losses from foreclosures and plunging home prices after the real estate bubble had burst.

Fannie Mae reported net income of $17.2 billion for 2012, compared with a loss of $16.9 billion in the prior year, as rising home prices supported the credit quality of Fannie-acquired loans. Home prices rose 5.8 percent in 2012, according to data compiled by Fannie's regulator.

"This change was driven by improvement in the profile of our single-family book of business due to continuing positive trends in the housing market and our ongoing efforts to improve the credit quality of our single-family guaranty book of business," the company said in a statement.

Fannie Mae Chief Executive Officer Timothy Mayopoulos said in a call with reporters on Tuesday, "2012 really marked a turning point for us." 

The company said in its filing that despite its higher profit, it was not taking a tax-related gain that could have added as much as $59 billion more to profit. Recording those gains would have forced the company to pay a bigger dividend to the U.S. Treasury, and would have made less bailout support available to Fannie Mae in the future.

The company's bottom line also was helped by settlements with Bank of America related to subprime mortgages issued by Countrywide Financial Corp., which BofA acquired in 2008.