For the Democrats, it was the latest failure of their campaign to force Bush to accept their troop withdrawal timetable.
The Democrats have been saying that the US involvement, in its fifth year and requiring 158,000 troops, have not stopped the fighting in Iraq.
Senator Joseph Biden, a Democrat who chairs the foreign relations committee, said: "We have to get us out of the middle of a civil war."
A political solution must be found "so when we leave Iraq, we don't just send our children home, we don't have to send our grandchildren back".
As members cast their votes, Condoleezza Rice, the secretary of state, hurried between private meetings with lawmakers in their offices to make the administration's case for the war.
As per the Democratic proposal, presented by Senators Carl Levin and Jack Reed, while the majority of US troops would return by April 2008, an unspecified number of soldiers could stay behind to conduct a narrow set of missions such as counterterrorism, protecting US assets and training Iraqi security forces.
Republicans were mostly unified in their opposition to setting a deadline for troop withdrawals, but there were a few exceptions. Three Republicans - Senators Gordon Smith, Olympia Snowe and Chuck Hagel - had announced previously that they would support the measure.
Senator Susan Collins, another Republican, who is up for re-election next year, also voted to advance the bill. Spokesman Kevin Kelley said Collins believes the measure should be subject to a simple majority vote and not the 60 votes needed to end parliamentary delaying tactics. Kelley said the senator still opposes the legislation.
"The amendment tells our enemies when they can take over in Iraq"
Saxby Chambliss, Republican Senator
Other Republican members, while uneasy about the war, said they could not support legislation that would force Bush to adhere to a firm pullout date.
But Harry Reid, Democratic senate majority leader, criticised Republicans
for using senate procedure to require a 60-vote super majority, and accused them of protecting the president and not US troops.
People "understand, very clearly, that we have a situation where we have a president who will be in office only another 17 months and they want the war to end before he leaves office," Reid said.
Hillary Clinton, Democratic senator and presidential candidate, said; "Many of us have been searching for the best approach to take with respect to our involvement in Iraq for a number of years
"But we don't do it with any sense that we know everything that will happen no matter what decisions are taken. But what we do have is a history of miscalculations and mistakes that we are now attempting to deal with."
Hillary Clinton had voted to authorise the war in 2002 but has now turned against it.
The US military's losses in Iraq since the March 2003 invasion are now at 3,621, according to an AFP count based on Pentagon figures. Tens of thousands of Iraqi civilians are also dead.