George Bush, the US president, said he would veto the deal.
"A narrow majority in the House of Representatives abdicated its responsibility by passing a war spending bill that has no chance of becoming law and brings us no closer to getting the troops the resources they need to do their job," he said at a White House press conference.
"It's a historic moment for our party and a historic moment for our country"
Nancy Pelosi, House Speaker and Democrat
He has insisted that US politicians grant more time for a recent increase of nearly 30,000 American troops into Iraq to bring change.
The senate could vote as early next week on its own version of the war-spending bill and a deadline for withdrawing.
Democratic leaders will need the support of about a dozen Republicans to get necessary 60 votes in the senate to prevail on troop withdrawal legislation.
David Obey, the chairman of the house appropriations committee, opened the floor debate, saying a vote for the spending bill would mean "that we're going to end the permanent, long-term, dead-end babysitting service. That's what we are trying to do".
Surfdog 1958, Baton Rouge, USA
Send us your viewsNancy Pelosi, House speaker and Democrat, encountered opposition from liberals and moderates in her Democratic Party while seeking to round up the 218 votes needed in the 435 member House.
She said: "It's a historic moment for our party and a historic moment for our country."
In a highly partisan vote, all but two House Republicans voted against the legislation, which they say will tie military leaders' hands and contribute to failure in Iraq.
"We have no choice but to win. If we fail in Iraq, you'll see the rise even further and faster of radical terrorism all around the world," said John Boehner, House Republican leader.
The bill would provide emergency funding for US troops fighting in Iraq and Afghanistan for the rest of this year, but lays out timetables for withdrawing combat troops, dependent on benchmarks including the Iraqi government's progress in securing its country.
The bill also provides domestic funds for farmers, veterans' health care and continuing rebuilding Gulf Coast states hit by hurricanes.