The House Wednesday approved a bill to repeal a provision that protected bonuses like those paid out to controversial insurance giant AIG.

Sen. Chris Dodd, D-Conn., dropped the language into an economic stimulus package that Congress adopted in the winter. It exempted bonuses previously agreed-to by companies that received rescue money from the federal government.

The new bill, which passed 247-171, would allow the bonuses if the Treasury Department and financial regulators determine they are not "unreasonable or excessive."

Many lawmakers vilified AIG after it paid out $165 million in bonuses after receiving assistance from Washington.

"No one has the right to get rich off taxpayer money" and "no one should get rich off abject failure," said Rep. Alan Grayson, D-Fla., a co-sponsor of the bill.

While other lawmakers agreed, they struggled to find consensus on an issue that has roiled voters.

Earlier in the day, Democrats failed to ram through a separate, more punitive measure. That bill, championed by Rep. John Conyers, D-Mich., would have let the attorney general sue employees to return excessive compensation, even if the money was promised in a contract.

The daylong debate was markedly cooler than last month after AIG shelled out $165 million in bonuses to employees, including traders in the financial products unit that nearly brought about insurance company's collapse. The company has accepted $182 billion in federal aid.

Denouncing a "squandering of the people's money," the House agreed 328-93 last month to tax away the bonuses.

But that bill, along with the latest measure, remains stalled in the Senate, where Democratic leaders said they planned to wait to act on bonus legislation until after Congress returns on April 20 from its two-week spring break.

Senate Majority Leader Harry Reid, D-Nev., will be "looking at this idea and others over the next few weeks," his spokesman, Jim Manley, said.

Initially after the AIG flap, President Obama had said he would "do everything we can to get those bonuses back." But later, he warned the public against vilifying investors as he unveiled a new government-sponsored program encouraging private investors to buy up the billions of dollars of sour mortgage securities.

The latest House bill, sponsored by Grayson and Rep. Jim Himes of Connecticut, heeded Obama's message and took a softer tack. Under the bill, Treasury Secretary Timothy Geithner and financial regulators would set standards for employee compensation at companies that accept bailout money, taking into account an employee's performance, as well as the stability of a financial institution.

Rep. Barney Frank, D-Mass., chairman of the House Financial Services Committee, said the bill would apply only to institutions that receive money through the government's $700 billion Troubled Asset Relief Program and would not apply to those participate in other TARP-related programs, including Obama's new public-private investment program.

The House agreed to an amendment by Rep. Melissa Bean, D-Ill., that exempts companies that enter into a payment schedule with Treasury to repay federal aid.

The 223-196 vote on the bill by Conyers, who chairs the House Judiciary Committee, was short of the two-thirds support needed to suspend the rules and limit debate on the bill.

Ultimately, 31 Democrats sided with Republicans to block it. Several aides said Democrats worried the measure went too far to try to punish the financial industry and could deter investors from partnering with the government to try to salvage the economy.

The Associated Press contributed to this report.