Both the Senate bill and a similar House bill call for creating a fund under the Federal Housing Administration to let thousands of distressed borrowers refinance into government-guaranteed loans.
The legislation would have the two government-sponsored enterprises cover a large share of the losses that the new fund is expected to absorb.
The committee passed the legislation on a vote of 19 to 2 after the top Democrat and Republican on the panel crafted a compromise that won broad bipartisan support.
Now, the legislation must pass the full Senate and then be reconciled with a similar plan that cleared the House earlier this month.
Democratic Sen. Christopher Dodd of Connecticut, chairman of the Senate panel, has said he hopes to see the mortgage rescue package reach President Bush by July 4.
The White House had threatened to veto the House bill, but has said it will take a close look at the version that cleared the Senate committee.
"I don't believe the president will veto this. I hope not," Sen. Richard Shelby of Alabama, the top Republican on the banking panel, told reporters after the vote.
Rep. Barney Frank, chairman of the House Financial Services Committee and author of the House-passed bill, said Tuesday he expects lawmakers will be able to hammer out a compromise between the two bills and deliver it to Bush.
The House version could guarantee up to $300 billion in refinanced mortgages and would assist about 500,000 borrowers at a cost to taxpayers of an estimated $1.7 billion.
The White House objected specifically to the cost of the FHA refinancing fund. Those objections were shared by Shelby.
After weeks of haggling, Shelby and Dodd agreed to scale down the FHA refinancing fund so its cost would be only about $500 million. Dodd said the bill would still help a similar number of homeowners as the House version.
Under the Senate bill, the cost would be covered by diverting money from an affordable housing trust fund to be set up under Fannie and Freddie .
Under the trust fund proposal, the two companies would contribute a share of their profits to create a pot of money for housing advocacy groups to expand affordable housing.