Top executives at Fannie Mae and Freddie Mac on Wednesday defended their companies' pay practices from attack by lawmakers angry that the government-controlled firms were paying out nearly $13 million in executive bonuses.

The chief executives of Fannie Mae and Freddie Mac's argued the compensation structures at the mortgage finance firms were needed to retain and attract qualified staff.

A bill to block the pay packages was approved by the House Financial Services Committee on Tuesday in a 52-4 vote. The full House must still vote on the measure. A similar bill has been introduced in the Senate.

The two money-losing firms have been propped up by about $169 billion in federal aid since they were rescued by the government in 2008.

In testimony before a U.S. House of Representatives committee, the executives said cutting compensation at their firms would be disruptive and limit their ability to attract skilled management.

We need to compensate our executives and employees to ensure that we have and keep the leadership we need to continue our progress, Fannie Mae CEO Michael Williams told the House Oversight Committee.

Republicans and Democrats in the House and Senate have expressed chagrin that the companies, the two largest sources of U.S. mortgage finance, were paying out $12.79 million in bonuses for 10 executives.

At the hearing, Democrats also blamed the companies and their regulator, the Federal Housing Finance Agency, for not doing enough to help troubled borrowers by reducing loan balances.

Congress and the president passed a law directing FHFA, Fannie Mae, and Freddie Mac to 'maximize assistance for homeowners.' This has not happened, said Representative Elijah Cummings, the panel's top Democrat. And nobody should be receiving million-dollar bonuses by claiming it has.

PLEASE DON'T LEAVE

Democrats and Republicans agree the firms eventually need to be shuttered, but lawmakers are moving cautiously given the central role the companies play in the housing finance system.

Williams argued that without legislative direction from Congress on the future of the two government-sponsored enterprises, it was difficult to attract and retain employees with highly specialized skills, expertise and experience.

Freddie Mac CEO Charles Haldeman and FHFA's acting director, Edward DeMarco, presented a similar case.

In addition, Haldeman, who plans to leave Freddie Mac once a replacement is found, said the company had reduced compensation for the top 10 percent of the management team by about 40 percent since it was seized by the government.

The bill approved by the House Financial Services Committee on Tuesday would suspend the compensation packages for executives at both companies and require employees move onto a pay scale that is in line with federal financial regulators.

Surely there are talented people that can handle these jobs and do it with a pay scale that is appropriate for government agencies, said Representative Carolyn Maloney, a New York Democrat.

Despite broad support in the House, the legislation could face an uphill climb in the Senate. Sen. Tim Johnson, chairman of the Senate Banking Committee, on Tuesday expressed concern the bill could lead to a brain drain at the firms.

At the hearing on Wednesday, DeMarco, who signed off on the pay, also criticized the idea of using a government pay scale for private companies doing $1 trillion of annual new business. They should be compensated at a market rate, he said.

The regulator said he intends to lower the bonus levels over time, and warned that moving too fast would push up staff turnover and undercut the firms at a delicate time.

Turnover at Freddie Mac has averaged about 13 percent in the past two quarters, well above its five-year average of about 8 percent, he said. Fannie Mae's turnover rate sits at about 11 percent a year after averaging about 6 percent over the previous three years.

A sudden and sharp change in pay would certainly risk a substantial exodus of talent, the best leaving first in many instances, DeMarco told lawmakers.

(Reporting by Margaret Chadbourn; Editing by Padraic Cassidy)