The final 338-83 roll call underlined the popularity of the government-wide measure that had something in it for almost every member of Congress.
Senate passage was expected today. President Bush is expected to sign the measure into law.
In the last frantic days of House-Senate bargaining, members of Congress and the Bush administration won funds that had not been included earlier. Lawmakers threw in $3.1 billion to help farmers and ranchers; $1.5 billion to help states revamp their election systems; and $54 billion over 10 years to increase Medicare payments to doctors and hospitals.
The White House won $10 billion for added defense spending that Bush originally requested a year ago.
Thousands of home-district projects for senators and representatives of both parties are included in the bill. One section alone divided $315 million for wastewater grants among 484 such projects. The listing ran from $1.6 million for a water main in Palmer, Alaska, to $572 million for water system improvements in Beach Bottom, W.Va. Those two states are represented by the top members of the Senate Appropriations Committee, Ted Stevens, R-Alaska, and Robert Byrd, D-W.Va.
The measure was opposed by an odd coalition: some Democrats complaining it shortchanged education, domestic security and park lands, and conservative Republicans angry that it spent too much.
Wins for Bush included the added defense spending, and the fact that its final price tag was billions below what many Democrats wanted.
But it also contained many billions of dollars he had not initially sought for farm aid, highway construction, doctors and hospitals -- and a $2.2 billion advance on 2004 education spending. But that money that did not count against the bill's price tag because it comes from different budget accounts.
Fishing interests, the timber and energy industries, and farmers north and south also benefited.
The measure would provide $53.1 billion for the Education Department, $3.1 billion more than Bush requested. Democrats cited that as a victory.
The measure also included:
* $15.4 billion for NASA, $500 million over last year. It included $50 million to let the space agency investigate the Feb. 1 destruction of the Columbia.
* $3.5 billion for local police, firefighters, emergency personnel and other "first responders." Democrats argued that Bush had promised a "new" $3.5 billion for these programs and that the figure was only $1.2 billion more than was provided a year ago.