The package, approved 92-6, includes a doubling of GI Bill college benefits for troops and veterans. It also provides a 13-week extension of unemployment benefits and $2.7 billion in emergency flood relief for the Midwest.
The Senate, however, narrowly failed to approve a House-passed bill to cancel a scheduled cut in payments to doctors who treat Medicare patients.
It also failed to resolve differences over home mortgage legislation and the administration's electronic surveillance program. Those matters will await lawmakers when they return from a 10-day July break.
The spending bill will bring to more than $650 billion the amount Congress has provided for the Iraq war since it started more than five years ago. For operations in Afghanistan, the total is nearly $200 billion, according to congressional officials.
Last week, the House approved the war funding measure, 268-155. The domestic add-ons were approved separately by a 416-12 vote. The White House has said it supports the combined measure, which technically allowed the measure to advance without senators having to vote specifically for the war funding, a distasteful matter for many Democrats.
As for Medicare, a 10.6 percent reduction in doctors' payments remains scheduled to take effect Tuesday. It was triggered by Medicare spending levels that exceeded established targets.
The Senate fell one vote short of the 60 needed to pass the bill under expedited rules. Nine Republicans joined Democrats in backing it. But most of the Senate's 49 Republicans voted against it, noting that the Bush administration has hinted at a possible veto. The insurance industry, in particular, opposed the bill.
Senate Majority Leader Harry Reid, D-Nev., changed his vote from yes to no in a procedural move to enable him to bring up the bill later. He ridiculed Republicans who sided with Bush in opposing the bill.
"Who would be afraid of him?" Reid said as many senators looked on. "He's got a 29 percent approval rating."
Some of the roughly 600,000 doctors who treat Medicare patients have said they would be reluctant to take on new elderly and disabled patients if the reimbursement cut takes effect.
Avoiding the cuts in Medicare physician payments has become an annual event for Congress, but finding the money invariably requires trimming payments to other health care providers. Democrats this year focused on taking the money from the Medicare Advantage program. It lets the elderly and disabled receive health benefits through a private insurer rather than through traditional Medicare.
The bill that fell short Thursday would have reduced payments to insurers by about $14 billion over five years. Insurers say the financial hit would have come at the expense of millions of Medicare Advantage participants.
But Democratic lawmakers, citing findings by an independent advisory commission, said the payments are overly generous and make it harder to sustain Medicare for future generations.
Many pharmacists support the bill because it would delay payment cuts through Medicaid. Pharmacists also support a provision that would require Medicare drug plans to reimburse them within 14 days of an electronic billing and within 30 days for paper claims.
The bill has also generated support from rural hospitals and ambulance providers that would have received more Medicare funding.
In the House, lawmakers approved financial help for mass transit systems facing a surge in riders because of high fuel prices. But Republicans blocked Democrats from requiring oil and gas companies to forfeit their leases if they don't drill on the millions of acres of government land and water they lease.
Senators were unable to resolve differences on the housing and surveillance legislation. A dispute over taxes continued to stall the mortgage-finance bill, which would allow the government to back $300 billion in cheaper loans for homeowners facing foreclosure.
Majorities in both chambers appear to support such a bill. But Senate progress faltered when Sen. John Ensign, R-Nev., insisted on adding an $8 billion package of tax breaks for renewable energy producers.
The incentives have bipartisan backing. But House Democrats oppose including them without balancing them with tax hikes to prevent an increase in the deficit.
The surveillance bill would provide legal immunity to telecommunications companies that helped the government wiretap American phone and computer lines without court permission after the Sept. 11 terror attacks.
It also would make it easier for the government to tap the calls and e-mails of suspected terrorists. Its detractors contend that it does not protect Americans' privacy rights while its champions argue that it strikes the right balance between civil liberties and security. The bill passed the House with a strong majority last week.