For the first time, the House of Representatives is setting a deadline for US participation in the Iraq war. It voted by a thin margin to pull combat troops out by next year and pushed the new Democratic-led Congress ever closer to a showdown with President George W. Bush. Friday's 218-212 vote, mostly along party lines, was a hard victory for Democrats, who faced divisions within their own ranks on the rancorous issue. Passage marked their most brazen challenge yet to Bush on a war that has killed more than 3,200 troops and tens of thousands of Iraqis and has lost favor with the American public. While Friday's House vote represented the Democrats' latest intensifying of political pressure on the Republican Bush, they still face long odds of ultimately forcing him to sign such legislation. In the Senate, Democratic leaders will need 60 votes to prevail. That is a tall order because that would mean persuading about a dozen Republicans to join them. Should lawmakers send Bush a measure he rejects with his veto, both chambers would need two-thirds majorities to override, margins that neither seems likely to muster. Bush dismissed the new majority party's action as "political theater" and said he would veto the bill should it reach his desk. The Senate soon will take up its own version. The $124 billion House legislation would pay for wars in Iraq and Afghanistan this year but would require that combat troops come home from Iraq before September 2008, or earlier if the Iraqi government should fail to meet certain requirements. Democrats said it was time to heed the mandate of their election sweep last November, which gave them control of Congress. "The American people have lost faith in the president's conduct of this war," said House Speaker Nancy Pelosi. "The American people see the reality of the war; the president does not." Just over an hour after the vote, Bush angrily accused Democrats of playing politics and renewed his promise to veto the spending legislation should it include their withdrawal timetable, despite administration claims that the money is needed next month by troops. "These Democrats believe that the longer they can delay funding for our troops, the more likely they are to force me to accept restrictions on our commanders, an artificial timetable for withdrawal and their pet spending projects. This is not going to happen," he said. Republicans countered that the bill would be tantamount to conceding defeat. "The stakes in Iraq are too high and the sacrifices made by our military personnel and their families too great to be content with anything but success," said Republican Whip Roy Blunt, the second-ranking Republican in the House. Congress so far has provided more than $500 billion for the wars in Iraq and Afghanistan, including about $350 billion for Iraq alone, according to the Congressional Research Service. Across the Capitol, the Senate planned to begin debate Monday on its own spending bill for the war, which also calls for a troop withdrawal and likewise has drawn a Bush veto threat. The Senate's $122 billion measure would require that Bush begin bringing home an unspecified number of troops within four months with a nonbonding goal of getting all combat troops out by March 31, 2008. These bills "offer a responsible strategy that reflects what the American people asked for in November: redeploying our troops out of Iraq and refocusing our resources to more effectively fight the war on terror," said Sen. Harry Reid, leader of the Senate's Democratic majority. Voting for the House bill were 216 Democrats and two Republicans. Of the 212 members who opposed it, 198 were Republicans and 14 Democrats. Those opposing Democrats included seven of the party's more conservative members, who say they do not want to tie the hands of military commanders. The other seven Democratic dissenters were members of a liberal anti-war caucus who routinely oppose war spending and would accept only legislation that would bring troops home immediately.