George Bush, the presdent, has dropped his earlier opposition and promised to sign the bill into law.
Before the vote, senators praised the bill as a product of "bipartisan co-operation" and said the legislation was vital to stem the fallout from a declining housing sector.
"You're having the worst of all possible worlds. Wealth is declining, the source of wealth creation and costs are rising simultaneously," said Chris Dodd, chair of the Senate Committee on Banking, Housing and Urban Affairs.
"When we consider the role home equity has played in support of consumer spending, we see the danger a vicious downward cycle could create."
The programme will be effective from October 1.
Citing figures on increasing home foreclosures, Dodd said: "Behind each one of these numbers I've cited here this morning there is a family, a mother, father, children trying to grow up facing unemployment, losing their homes, wondering what the future holds for them."
The success of the temporary fund will depend on lenders' willingness to accept losses on original loans to shift overstretched borrowers into new loans.