The 78-12 vote sent the $634 billion measure to President Bush, who was expected to sign it even though it spends more money and contains more pet projects than he would have liked.
The measure is needed to keep the government operating beyond the current budget year, which ends Tuesday. As a result, the legislation is one of the few bills this election year that simply must pass. Bush's signature would mean Congress could avoid a lame-duck session after the Nov. 4 election.
White House spokesman Tony Fratto said the bill "stands as a reminder of the failure of the Democratic Congress to fund the government in regular order." But, he said, it "puts the United States one step closer to ending our dependence on foreign sources of energy" by lifting the offshore drilling ban and opening up huge reserves of oil shale in the West.
The Pentagon is in line for a record budget. In addition to $70 billion approved this summer for operations in Iraq and Afghanistan, the Defense Department would receive $488 billion, a 6 percent increase. The spending bill also offers aid to victims of flooding in the Midwest and recent hurricanes across the Gulf Coast.
Such a huge bill usually would dominate the end-of-session agenda on Capitol Hill. But it went below the radar screen because attention focused on the congressional bailout of Wall Street.
The measure settles dozens of battles that have brewed for months between the Democrats who run Congress and the White House and its GOP allies.
The administration won approval of the defense budget. Democrats wrested concessions from the White House on $23 billion for disaster-ravaged states, a doubling of low-income heating subsidies, and smaller spending items such as $24 million more for food shipments to the elderly.
The loan package for automakers would reward them with $25 billion in below-market loans, costing taxpayers $7.5 billion to subsidize the retooling of plants and development of technologies to help U.S. carmakers to build cleaner, more fuel efficient cars. Companies would not have to begin repaying the loans for five years, drawing objections from Sen. Jon Kyl, R-Ariz., who predicted they would return for more help when the money is due.
Republicans made ending the coastal drilling ban a central campaign issue this summer as $4-plus per gallon gasoline stoked voter anger and turned public opinion in favor of more exploration.
The action does not mean drilling is imminent and still leaves the oil-rich eastern Gulf of Mexico off limits. But it could set the stage for the government to offer leases in some Atlantic federal waters as early as 2011.
Also in the bill is money to avert a shortfall in Pell college aid grants and solve problems in the Women, Infants and Children program delivering healthy foods to the poor.
In addition to the Pentagon's budget, there is $40 billion for the Homeland Security Department and $73 billion for veterans' programs and military base construction projects. Combined with the Defense Department's spending, that amounts to about 60 percent of the budget work Congress must pass each year.
Democrats came under criticism from the GOP for short-circuiting the normal process for a spending bill after it became clear that Republicans would force difficult votes on the drilling ban.
Democrats also wanted to avoid an election-year clash with Bush that would have played in his favor. They are willing to take their chances that Democrat Barack Obama will be elected president in November and permit increases for scores of programs squeezed by Bush each year.
Bush had threatened to veto bills that did not cut the number and cost of pet projects in half or cause agency operating budgets to exceed his request. Democrats ignored the edict as they drafted the plan and the White House has apparently backed down.
Taxpayers for Common Sense, a watchdog group, discovered 2,322 pet projects totaling $6.6 billion. That included 2,025 in the defense portion alone that cost a total of $4.9 billion. Critics of such projects are likely to discover numerous examples of links to lobbyists and campaign contributions.
House vote expected on oil drilling
House passes drilling bill