The giant mortgage lender was "working through the toughest housing and mortgage markets in a generation," said Chief Executive Officer Daniel H. Mudd.
Mudd said Fannie Mae had increased its credit reserves as it sought to build "a very strong credit book."
For the year, Fannie Mae lost $2.1 billion or $2.63 per diluted share compared with a net income of $4.1 billion and gains of $3.65 per diluted share in 2006.
The company said the first and second half of 2007 were "dramatically different."
"Beginning in the second half of 2007, results were severely affected by the disruption in the mortgage and credit markets and continued weakness in the housing markets," the company said.
Larry Ellison to step down as CEO of Oracle