Fannie Mae Chief Executive Michael J. Williams resigned Tuesday, saying he will depart as soon as the mortgage-finance giant's board names a successor.

His exit leaves the government scrambling to find new caretakers for Fannie and its sibling, Freddie Mac, at a time when policy makers at the Federal Reserve and the White House have singled out housing as a key obstacle to an economic recovery.

Just...