The Senate voted late Thursday to convert half the $20.3 billion Iraqi rebuilding plan into a loan -- defying the wishes of President Bush.

Despite an administration lobbying blitz that in recent days involved Bush himself, Vice President Dick Cheney (search), Secretary of State Colin Powell (search) and others, the Republican-run chamber voted 51-47 for a bipartisan proposal making $10 billion of the aid a loan.

"They rolled out all the heavy artillery they could find," said Sen. John McCain (search), R-Ariz., a one-time Bush rival who sided with the White House.

"Back home, people were asking for loans," said Senate Majority Leader Bill Frist, R-Tenn., in explaining the vote.

But Senate Minority Leader Tom Daschle, D-S.D., said the roll call was a slap at Bush's policies in Iraq.

"The Senate sent a strong, bipartisan message to this administration: It must do more to ensure that America's troops and taxpayers don't have to go on shouldering this costly burden virtually alone," Daschle said.

The loan proposal was the most dramatic change lawmakers have made in the mammoth spending package that the president proposed on Sept. 7.

Its approval by the Senate marked the first congressional vote in opposition to Bush's policies in Iraq. It was also the latest of several setbacks that Congress has dealt him in recent months on issues including concentration of media ownership, new rules on overtime pay, and travel to Cuba.

The administration argued that loans would worsen Iraq's foreign debt, slow its recovery and hand a propaganda victory to America's enemies. But the vote underscored that with presidential and congressional elections 13 months away, many lawmakers were more worried about vast new spending for foreign aid at a time of record federal deficits at home.

"It's very hard for me to go home and explain that we have to give $20 billion to a country sitting on $1 trillion worth of oil," said one loan supporter, Sen. Lindsey Graham, R-S.C.

The vote came as the House and Senate edged toward approval of similar $87 billion measures to finance American military operations in Iraq and Afghanistan, as well as the reconstruction of both countries. The lion's share of both bills is about $66 billion for U.S. military operations in Iraq and Afghanistan, funds over which there was little controversy.

About two hours before the Senate roll call, the GOP-led House voted 226-200 to kill a similar loan proposal introduced by Democrats. The two chambers will have to negotiate compromise language before a final bill is sent to Bush for his signature -- which congressional leaders hope to do before next week's conference of donor nations in Madrid, Spain.

Frist and other GOP leaders said they would try to restore the grants in House-Senate bargaining.

"They've counted him [Bush] down and out before. It's just another bump in the road," said Tom Korologos, a congressional lobbyist for the U.S.-led Coalition Provisional Authority now running Iraq.

Eight Republicans abandoned Bush and voted to change his plan: Sens. Sam Brownback of Kansas, Ben Nighthorse Campbell of Colorado, Saxby Chambliss of Georgia, Susan Collins and Olympia Snowe of Maine, John Ensign of Nevada, Lindsey Graham of South Carolina, and Lisa Murkowski of Alaska.

Democrats who opposed the loan proposal were Joseph Biden of Delaware, Maria Cantwell of Washington, Daniel Inouye of Hawaii, and Zell Miller of Georgia.

Under the bipartisan loan amendment, the money would be transformed into a grant if other countries agreed to forgive at least 90 percent of the debt they were owed by Iraq. That debt is usually estimated at between $90 billion and $127 billion.

While the Senate bill provided the full $20.3 billion for rebuilding that Bush sought, the House measure chopped it down to $18.6 billion. It did so by erasing politically fragile proposals: funds for buying $50,000 garbage trucks, creating Iraqi ZIP codes and restoring the country's marshlands.

The administration and its supporters wanted the rebuilding assistance to be entirely grants financed by U.S. taxpayers. They warned that loans would nurture Arab suspicions about the United States' true motivation in Iraq.

"The battle for the hearts and minds of the Iraqi people is not over by a long shot," said McCain. He said the amendment "will send a clear signal that the United States is really, really there for the oil."

Cheney called senators during the day hoping to block the loan plan, congressional aides said. And two senators -- Arlen Specter, R-Pa., and Kay Bailey Hutchison, R-Texas, who had initially said they supported loans switched Thursday and said they had been persuaded to oppose them.

But as the day wore on in the Senate, expressions of optimism by administration officials and GOP Senate aides faded.

The White House budget office released a statement saying the administration strongly opposed loans. But the letter omitted any mention of a veto threat, which the office sometimes includes to send a strong message of opposition.

The sponsors of the Senate loan amendment were Republicans Chambliss, Collins, Ensign, Graham, and Snowe and Democratic Sens. Evan Bayh of Indiana, Hillary Rodham Clinton of New York, and Ben Nelson of Nebraska.

"The loan is there to give an incentive to the holders of prewar debt to forgive their loans, and then we will forgive ours," Nelson said.

Sens. Robert Byrd, D-W.Va., and Joseph Lieberman, D-Conn., did not vote.

The Associated Press contributed to this report.