Yet with their party’s political prospects looking bleak, 32 Republicans joined 224 Democrats in the vote, which was 256 to 166, to approve the veterans benefits and the accompanying tax as well as extra unemployment benefits for idle workers, up to 26 weeks in especially hard-hit areas. The package also included nearly $6 billion for Louisiana levees and $1.8 billion for international food and disaster aid.

Democrats have been reluctant to pursue income tax increases in recent years, but this year House leaders did push a tax increase on hedge fund managers earning huge paychecks, though it failed to survive the Senate.

The fate of the tax to pay for the veterans benefits was also uncertain in the Senate, where Republicans were opposed to it and some Democrats were registering initial reservations. Senators have been more willing to add spending to legislation without finding ways to pay for it, while the House tax plan was developed to soothe conservative Democrats worried about the impact of the new G.I. benefit on the deficit.

The White House this week issued a veto threat against the overall measure, singling out the tax increase to pay for veterans benefits as a top reason. “The president has been clear that tax increases are unacceptable,” the Office of Management and Budget said in a statement.

In the roll call on the $163 billion for the war operations, 132 Republicans withheld their votes in protest of Democratic handling of the measure. At the same time, a large bloc of antiwar Democrats unwilling to provide new money for the conflict voted against the financing, causing it to fail on a 149-to-141 vote.

Leaders of both parties said the result had not put the war spending in real jeopardy, since it was expected to be restored in the Senate, where a December 2009 deadline to withdraw combat troops from Iraq and other war restrictions passed by the House were expected to be killed. House members would then get another chance at the financing, and it was unlikely that Republicans would stand in the way a second time.

The defeat of the war money took House Democrats by surprise since Republicans in the past had been willing to provide the necessary votes to push through the financing despite the objections of most Democrats. But Republicans have been complaining for weeks that the war spending measure was being assembled by Democrats with no Republican involvement or even the opportunity to offer amendments.

Democrats said the decision by so many Republicans to abstain was irresponsible since it was those lawmakers who have been so supportive of the war. They said the action by Republicans appeared to be an effort to find some new approach in the wake of a series of election defeats capped this week by the loss of a highly conservative Republican district in Mississippi.