WASHINGTON — The House overwhelmingly approved on Thursday a near total tax on bonuses paid this year to employees of the American International Group and other firms that have accepted large amounts of federal bailout funds, rattling Wall Street as lawmakers rushed to respond to populist anger.

Despite questions about the legality of the retroactive 90 percent levy, Democrats and some Republicans said the tax on bonuses for traders, executives and bankers earning more than $250,000 was the quickest way to show angry Americans that Congress intended to recoup the extra dollars. Even backers of the measure noted it was an extraordinary step.

The House vote sent some employees into a panic about the prospect of, in effect, having to give up money they might already have spent. And it had regulators fearing it could undermine the Treasury’s efforts to stabilize the financial system if banks tried to flee the bailout program or if other firms refused to participate in coming rescue operations to protect their bonuses, some executives said.

Vikram S. Pandit, chief executive of Citigroup, lobbied against the legislation in a meeting Thursday with the Senate majority leader, Senator Harry Reid, according to an industry official.