The head of Fannie Mae and his firm's government overseer on Tuesday defended the use of millions of taxpayer dollars to pay legal bills for former executives accused of fraud.

Michael Williams, Fannie Mae's chief executive and Edward DeMarco, director of the Federal Housing Finance Agency, each told a U.S. House of Representatives panel that not paying for the legal aid would be counterproductive and generate more lawsuits.

If Fannie Mae were to refuse to this obligation, we would undoubtedly be sued and likely subject to additional costs, Williams said in prepared testimony to the House Financial Services Subcommittee on Oversight and Investigations.

Fannie Mae, along with its sister organization Freddie Mac, was seized by the Bush administration in 2008 amid mounting losses from mortgages gone sour and is now effectively under government control.

As a result of that takeover, the government took on existing obligations the privately owned companies already had as result of employment contracts and company by-laws to defend their former top executives against earlier charges of fraud and accounting irregularities.

Since the government takeover, taxpayers have shoveled more than $160 million defending the two firms and their former top executives. About $24.2 million of the total went to former Fannie Mae chief executive Franklin Raines and two other senior executives, according to California Republican Representative Darrell Issa.

Raines left the company in 2004 following an accounting scandal.

DeMarco echoed Williams' assertion that not paying the legal fees would lead to more legal fees being paid to defend that decision.

FHFA believed the continued advancement of funds was in line with the conservatorship and that actions to interfere would be counterproductive due to the ability of individuals denied to sue the agency for such actions, DeMarco said in his prepared testimony to be delivered Tuesday afternoon.

(Reporting by Corbett B. Daly; Editing by Chizu Nomiyama and Andrew Hay)