Fannie Mae reported Tuesday that it earned $7.6 billion in the final quarter of 2012, capping its most profitable year in history and raising the prospect that the company will be able to survive without government support before too long.

District-based Fannie Mae and its corporate relative, McLean-based Freddie Mac, have enjoyed an unexpected resurgence as the housing market has recovered and the financial crisis that sent the firms into the hands of taxpayers faded into history.

Fannie made a total profit of $17.2 billion last year and has paid taxpayers $35.6 billion in return for the lifeline of financial support that was instituted in September 2008, when the government seized the firm.

Under the terms of Fannie’s arrangement with the Treasury Department, taxpayers collect virtually all profit earned by the company. Fannie still owes taxpayers $117 billion.

The company is expected to pay taxpayers nearly $60 billion in the next several months as Fannie’s long-term profitability becomes even more assured and the firm is forced to recognize long-standing tax assets that had no value when the company was deep in the red.

Freddie is also sending billions into taxpayer coffers, although not quite at the same rate as Fannie.

Last year “really marked a turning point for us,” Fannie chief executive Timothy Mayopoulossaid during a conference call Tuesday.

Fannie’s gains, the company said, reflected a decline in mortgage delinquences, an increase in home prices, the sales of foreclosed properties owned by Fannie, and other factors.

Sen. Bob Corker (R-Tenn.), a member of the Senate Banking Committee, said Fannie and Freddie’s profitability should add urgency to efforts to revamp the companies. What’s more, he said, they have been successful because Congress allowed the mortgage financing firms to service high-priced loans and because of the Federal Reserve’s efforts to reduce interest rates.

“It’s great that Fannie Mae and Freddie Mac are showing an increase in income,” Corker said in a statement. But market conditions have “made Fannie or Freddie the only viable execution option for new loans.”