President Bush says opposition demands to pull US troops out of Iraq by October would embolden the enemy.
In a nation-wide address moments after vetoing the spending bill, the president called it a prescription for chaos and confusion.
"I believe setting a deadline for a withdrawal would demoralize the Iraqi people, would encourage killers across the broader Middle East, and send a signal that America will not keep its commitments. Setting a deadline for withdrawal is setting a date for failure. And that would be irresponsible."
Because the measure passed the House and Senate by close votes, it is highly unlikely opposition Democrats can find the two-thirds majority to over-ride this veto.
Still, Democratic leaders sent the doomed legislation to the White House Tuesday to show their opposition to what Senate majority leader Harry Reid says are US troops mired in the middle of an open-ended civil war.
Reid says the president now has the obligation to explain how he will responsibly end the war, and Democrats will work with him.
"But if the president thinks that by vetoing this bill he will stop us from working to change the direction of the war in Iraq, he is mistaken.
A public opinion poll by CBS News and the New York Times says more than 70% of Americans disapprove of how the president is handling the war. Two-thirds of those surveyed support setting a timetable for the withdrawal of US troops.
President Bush says he wants US troops out of Iraq as well, but only when the government there is better able to handle its own security.
Mr. Bush vetoed the legislation on the fourth anniversary of his much-publicized appearance on the deck of the aircraft carrier USS Abraham Lincoln under a banner which read: Mission Accomplished. At the time, he told sailors that they had freed Iraq and made America more secure.
"Major combat operations in Iraq have ended. In the battle of Iraq, the United States and our allies have prevailed."
Fewer than 200 Americans had been killed in Iraq when the president spoke four years ago. The death toll now is over 3,000.
White House spokeswoman Dana Perino says the United States and its allies did prevail in terms of toppling the Iraqi army and Saddam Hussein. She accused Democrats of a trumped-up political stunt that is the height of cynicism for delaying the bill until this fourth anniversary of what has come to be known as the Mission Accomplished speech.
The president meets Wednesday with Republican and Democratic leaders of the House and Senate to talk about how to move forward on new legislation to pay for the wars in Afghanistan and Iraq.