Approval of the budget - which includes $70 billion for the wars in Iraq and Afghanistan - ends a year-long battle between Republican and Democratic lawmakers over U.S. spending priorities.
Democrats won control of Congress in November 2006 and announced a goal of bringing U.S. troops home from Iraq. They also had plans to boost domestic spending by $22 billion.
But President Bush threatened to veto any spending bill that contained a timetable for U.S. troop withdrawals, and Democrats were unable to muster enough votes to override the threatened veto.
Democratic Senate Majority leader Harry Reid conceded that Republicans won this political battle, and he called it a loss for the American people.
"And while they win their so-called battle of obstruction, American people are losing," he said. "Millions of low-income children don't have access to health care, less police officers on the street, less funding to find cures for dread disease. What we have is Republicans digging in their heels for the status quo."
Republicans had long insisted on a spending bill that funds the war in Iraq without mentioning a timetable for withdrawal. Republican Senator Jon Kyl said the bill is crucial to U.S. troops.
"First of all, it sends a message to our troops that we support them," he said. "There's been a little confusion about that, and given the fact that the Petraeus plan has had such great success in bringing violence down and bringing control of the country much more along the lines that the United States would like to see and our allies there, it is a way to say to the troops we appreciate what you have done and we are not going to pull the rug out from under you."
The half-a-trillion-dollar appropriations bill combines funding for all government departments except defense, covering housing, law enforcement and transport. Although they were unable to fund many of their favorite projects, Democrats did manage to include about $11 billion in spending for health care for veterans, drought relief, firefighting and border security.
The White House has said it will sign the bill if it contains funding for Iraq.