The government-controlled company said Wednesday that it paid a dividend of $2.9 billion to the U.S. Treasury and sought no additional federal aid.
It was Fannie's third profitable quarter since being taken over by the government during the 2008 financial crisis. The gain compares with a net loss of $5.1 billion in the same period last year.
"We are seeing signs of sustained improvement in housing," Fannie President and CEO Timothy Mayopoulos said in a statement. "Our financial condition has improved markedly."
The government rescued Fannie and smaller sibling Freddie Mac after both incurred massive losses on risky mortgages. Taxpayers have spent about $116 billion to rescue Fannie. So far, the company has repaid the government $23 billion.
The housing market is finally starting to recover more than five years after the crisis. Home sales are higher than last year, prices are rising on a consistent basis and builders are starting more homes. The market still has a long way back to full health.
The recovery is also helping Fannie and Freddie rebound.
Freddie Mac said Tuesday that it earned $2.9 billion in the July-September quarter and paid a dividend of $1.8 billion to the U.S. Treasury. It was Freddie's fourth straight profitable quarter.
Fannie and Freddie are required to pay 10 per cent dividends on the government money they receive.
Under a new federal policy announced last summer, Fannie and Freddie have to turn over all profits they earn every quarter to the government. The change was made to ensure that the companies pay the government back.
Fannie and Freddie own or guarantee about half of all U.S. mortgages, or nearly 31 million home loans. Along with several federal agencies, they backed nearly 90 per cent of new mortgages over the past year.