Fannie Mae, the federally controlled mortgage giant, said Tuesday it is naming its general counsel, Timothy Mayopoulos, as its new president and CEO.

Mayopoulos, a former general counsel of Bank of America Corp. (NYSE: BAC), will replace Michael Williams, a 21-year veteran of Fannie Mae. Fannie reported a first-quarter profit of $2.7 billion and did not require taxpayer aid for the first time since the 2008 financial crisis. Mayopoulos will retain his current salary of $2.66 million this year, but will receive a pay cut to $600,000 next year, following legislation that limits the executive compensation of Fannie and its sibling, Freddie Mac.

We have a responsibility to return value to taxpayers and to contribute our expertise and experience to building a more effective and stable housing finance system for the future, said Mayapoulos in a statement.