WASHINGTON — The House passed a $630 billion-plus spending bill Wednesday that wraps together a record Pentagon budget with aid for automakers and natural disaster victims, and increased health-care funding for veterans returning from Iraq and Afghanistan.

The year-end budget measure also would lift a quarter-century ban on oil drilling off the Atlantic and Pacific coasts. The legislation, which senators are expected to approve and send to President Bush for his signature, is flying under the political radar compared with the White House's contentious plan to bail out Wall Street.

The spending bill, which passed 370-58, is fueled by a need to keep the government running past the Oct. 1 start of the new budget year. Passage also was greased by 2,322 pet projects totaling $6.6 billion.

The measure is dominated by $488 billion for the Pentagon, $40 billion for the Homeland Security Department and $73 billion for veterans' programs and military base construction projects — amounting to about 60 percent of the budget work Congress must pass each year.

Earlier this year, Congress provided $70 billion for U.S. operations in Iraq and Afghanistan; more will be needed by mid-2009.

The budget legislation is the result of months of wrangling between Democrats who control Congress and the lame-duck Bush administration and its allies on Capitol Hill. The administration won approval of the defense budget while Democrats wrested concessions from the White House on disaster aid, heating subsidies for the poor and smaller spending items.

In a major victory for Republicans in this election season, Democrats capitulated and agreed to lift the offshore drilling ban. The move does not mean drilling is imminent. But it could set the stage for the government to offer leases in some Atlantic federal waters as early as 2011.

The administration also succeeded in blocking Democrats' efforts to extend unemployment insurance, increase food stamp payments and help states deal with shortfalls in their Medicaid budgets.

Democrats doubled the money for heating subsidies for the poor and successfully pressed the White House for a generous $23 billion aid plan for disaster-ravaged states. The measure would avert a shortfall in Pell college aid grants and address problems in the Women, Infants and Children program, which delivers healthy foods to the poor.

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. Majority Leader Steny Hoyer, D-Md., suggested additional progress on the budget could have been made had Bush signaled such flexibility earlier.

The legislation includes an increase for the census as well as money to cover transition costs for the incoming administration. It provides money for 20 F-22 fighter planes over and above the Pentagon request, and additional dollars for armored vehicles, body armor and combating roadside bombs.

Veterans' health programs are in line for a 10 percent increase; veterans driving to Veterans Affairs' medical clinics would get an increase in mileage reimbursements; federal firefighting accounts would be replenished; Georgia would receive $365 million in economic help to recover from the recent conflict with Russia.

After hard lobbying, automakers won up to $25 billion in low-interest loans to help them develop technologies and retool factories to meet new standards for cleaner, more fuel efficient cars.

The bill would pay, until March, for agencies whose budgets have not passed. This would eliminate the need for a much-dreaded, lame-duck session after the Nov. 4 election to deal with unfinished work.

The legislation came together in a remarkably secret process that concentrated decision-making power in the hands of a few lawmakers. They include House Appropriations Committee Chairman David Obey, D-Wis., and Pelosi.

Republicans blasted the process by which the measure came before the House. Lawmakers had just a few hours to scrutinize the 357-page measure — along with 752 pages of accompanying explanations and tables of previously secret pet projects — before the vote. Debate lasted less than one hour.

The rush also ran counter to Democratic promises for more open disclosure of billions of dollars worth of home-state pet projects sought by most lawmakers.

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. Among them was a long-standing request by the Iowa delegation for a new $182 million federal courthouse in Cedar Rapids, which was granted after flood damage this summer.

House Republicans had started a major campaign this year to add further reforms to the pet project process. But Republican protests Wednesday over such projects were limited at best. Instead, Republicans crowed over their success in lifting the drilling freeze.