The US House of Representatives has voted for a $555bn (£277bn) federal budget, with an extra $70bn for the US military in Iraq and Afghanistan.
Democrats had wanted funding to be tied to a pullout timetable
Faced with a veto threat from President George W Bush, Democrats dropped efforts to tie the funds to a timetable for a US troop withdrawal from Iraq.
The US Senate had already approved the Iraq funds on Tuesday.
The votes end a long-running battle in which Democrats tried unsuccessfully to change President Bush's war policy.
The approval comes as a quarterly report by the Pentagon for Congress said US forces had made "significant progress" in Iraq over the past three months, with the country becoming safer.
But the report cautioned that despite the progress on the security front, the handover to Iraqis was lagging, with Iraqi forces still dependent on US troops for logistics and training.
The half-a-trillion-dollar appropriations bill, passed on Wednesday, combines funding for all government departments except defence, and covers areas including housing, law enforcement and transport.
Congressmen voted 272-142 to back the measure.
The Democrats, who won majorities in both the Senate and the House of Representatives in November 2006, had tried time and again to impose a timetable for a withdrawal from Iraq.
Anti-war Democrats complained that the bill gave President Bush a "blank cheque" to run the Iraq war.
David Obey, a Wisconsin Democrat, said the only option to changing direction in Iraq was to "elect more progressive voices to the United States Senate" and to "elect a president with a different set of priorities."
Republicans said the bill needed to be passed without any further delay.
With Mr Bush standing firm and threatening to veto the entire budget - a move that could have paralysed federal agencies - the Democrats ended their attempts to impose conditions on money for Iraq.
The House of Representatives had passed a version of the budget bill on Monday, but it specifically excluded any new money for Iraq.
As well as arguments over Iraq funding, Senate Democrats and the White House were at odds over the scale of the budget, with Mr Bush seeking to keep below-inflation increases or cutbacks in many domestic programmes.
The White House said the budget largely adhered to the president's spending limits, but "it also addresses some of the bottom-line priorities of the American people", Democratic Senator Tom Harkin said.
The bill includes some $11bn in what is known as emergency spending for areas including health care for veterans, drought relief, border security and firefighting.
It includes $700m in economic and military aid to Pakistan, with some conditions attached, and $1bn for humanitarian and peacekeeping missions in Darfur.
It also sets out an increase in military aid for Indonesia which would get $15.7m, and the Philippines which is set to receive $30m.
Both are seen as key allies in South East Asia and crucial to tackling terrorism. Some of the money would, however, be conditional on human rights improvements.