Fannie Mae promoted its chief administrative officer and general counsel Timothy Mayopoulos to CEO.
Mayopoulos will replace Michael Williams, who said he would resign in January but would stay until a successor was chosen.
Mayopoulos was previously the top attorney for Bank of America (BAC) and served in senior management at Deutsche Bank and Credit Suisse.
"Tim delivers a combination of proven leadership and execution focus," said Fannie Chairman Philip Laskawy. "His deep understanding of the unique challenges Fannie Mae is facing and his effective working relationships with our regulator, management, the board, and external partners will serve the company and industry well."
Their departures followed scrutiny over bonuses given to them in 2011, but neither CEO said pay was a factor in their decision to leave.
Both companies drew $189.5 billion from the Treasury Department and paid back $41.1 billion in dividends.
Williams became CEO in 2009, a year after the GSE was put into conservatorship. Since 2009, Fannie has financed $2.6 trillion in mortgages as of March 31.
He led the company to its first quarterly profit since entering conservatorship.
Williams joined Fannie in 1991 as a senior vice president and led the development of Desktop Underwriter. In 2005, he was appointed to executive vice president for regulatory agreements.
"I know that I am leaving Fannie Mae in very capable hands with Tim as CEO," Williams said.
Federal Housing Finance Agency Acting Director Edward DeMarco supported the choice in a statement.
"Tim brings a breadth of knowledge and experience in housing finance and financial services that is vital at this important time for Fannie Mae and the nation’s housing finance system. I look forward to working with him on the next phase of the conservatorship and the efforts to transition beyond," DeMarco said.