Senate Democrats considering an Iraq spending bill mustered enough votes late this afternoon — (barely) at 50-48 — to defeat a Republican amendment that would have stripped out language setting a timetable for withdrawal of troops from Iraq.

The Senate’s actions, with a vote on the full measure expected as early as tomorrow, follows the House vote by four days. However the two bills are meshed, President Bush has vowed to veto whatever reaches his desk if it includes a timetable for removing troops from the war. The Democratic-backed Senate bill calls for troop withdrawal to commence within 120 days of the enactment of such a law, with them out by March 31, 2008.

The amendment defeated today was proposed by Senator Thad Cochran, a Republican, and cosponsored by nearly a dozen others. It contained this language as its mission:

To strike language that would tie the hands of the Commander-in-Chief by imposing an arbitrary timetable for the withdrawal of U.S. forces from Iraq, thereby undermining the position of American Armed Forces and jeopardizing the successful conclusion of Operation Iraqi Freedom.

As the Times’s Jeff Zeleny mentioned in an earlier post, Republican Chuck Hagel decided to vote with the Democrats in support of a timetable for withdrawal, as did Republican Gordon Smith of Oregon.

Senator Mark Pryor, Democrat of Arkansas, joined the Republicans, as did Senator Joe Lieberman, independent-Democrat.

There’s a procedural vote tomorrow morning, and the majority leader, Harry Reid, saying there were more than 100 amendments proposed on the bill. He and the minority leader, Mitch McConnell, were trying to figure out how to proceed with the main spending bill.