NEW YORK (CNNMoney.com) -- The Senate on Saturday overwhelmingly passed a landmark housing bill that will offer up to $300 billion in loans for troubled homeowners and establish a government rescue plan for mortgage finance giants Fannie Mae and Freddie Mac.

The House passed the bill on Wednesday just hours after President Bush reversed his long-standing vow to veto the bill. Bush is expected to sign it soon.

The legislation, one of the most far-reaching on housing in decades, marks the centerpiece of Washington's efforts to address the nation's housing meltdown.

"This legislation won't perform miracles. But as others have said, it's a step - and I hope an important step - to putting our nation on the road to economic recovery," said Sen. Christopher Dodd, D-Conn., chairman of the Senate Banking Committee and a principal author of the bill.

Following the vote, Dodd said he will meet on Tuesday with representatives from the Treasury, the Federal Reserve, the FDIC and the Department of Housing and Urban Development to discuss how the legislation can be implemented as quickly as possible. "I'm not going to tolerate a slow walk," he said.

Though the Senate vote was 72 to 13, the bill was not without its staunch opponents.

Sen. Charles Grassley, R-Iowa, the leading Republican taxwriter, had supported earlier versions of the legislation but objected to the rescue plan for Fannie and Freddie. "This bill has fallen prey to the special interests on Wall Street and K Street at an unjustifiable expense to taxpayers and homeowners on Main Street," Grassley said.

The White House also objected to parts of the bill, including aid to states to buy foreclosed properties. But White House Press Secretary Tony Fratto said the measures concerning Fannie and Freddie are "urgently needed now ... President Bush will sign this bill when he receives it, despite our concerns with some provisions."

The bill has two principal objectives: to offer affordable government-backed mortgages to homeowners at risk of foreclosure, and to bolster Fannie and Freddie with a temporary rescue plan and a new, more stringent regulator.

Helping at-risk borrowers

Provisions in the 700-page bill that would most directly affect consumers and communities include:

Increase the Federal Housing Administration's role. The FHA will be allowed to insure up to $300 billion in new 30-year fixed-rate mortgages for at-risk borrowers in owner-occupied homes if their lenders agree to write down loan balances to 90% of the homes' current appraised value.

The cost of the new FHA program - which would begin on Oct. 1 and be in place for just a few years - would be funded by fees from Fannie and Freddie, along with fees paid by both lenders and borrowers.

While the bill authorizes the FHA to insure up to $300 billion in loans, the CBO estimates that the agency is only likely to insure up to $68 billion and help keep roughly 325,000 people in their homes. Those estimates were based on the CBO's assessment of who is likely to qualify under the program and accounts for a certain number likely to default anyway.

(Here are more details on this provision.)

Establish a stronger regulator for the GSEs. The new regulator will have a greater say over how well funded the two government sponsered enterprises (GSEs) are - a major concern in the markets that has sent stocks in both companies plunging.

Permanently increase "conforming loan" limits. The bill would permanently increase the cap on the size of mortgages guaranteed by Fannie and Freddie to a maximum of $625,500 from $417,000.

The FHA maximum loan limits for high-cost areas would also increase to $625,500. Higher loan limits will make it easier for borrowers to get mortgages, because they're more likely to be traded if they are considered conforming.

Create home-buyer credit. The bill includes a tax refund for first-time home buyers worth up to 10% of a home's purchase price but no more than $7,500.

The refund, however, serves more as an interest-free loan, since it would have to be paid back over 15 years in equal installments.

Bar down-payment assistance for FHA loans. The bill eliminates a program that has allowed sellers to provide down payment assistance.

The bill would also increase to 3.5% from 3% the down payment requirement for borrowers getting FHA loans.

Create an affordable housing trust fund. The bill establishes a permanent fund to promote affordable housing. The fund would be paid for by fees from Fannie and Freddie.

Give grants to states to buy foreclosed properties. The bill would grant $4 billion to states to buy up and rehabilitate foreclosed properties. The funding had been opposed by the White House, which said it would benefit lenders and not homeowners.

Bolster Fannie and Freddie

Concerns over whether Fannie Mae (FNM, Fortune 500) and Freddie Mac (FRE, Fortune 500) will have enough money to weather future losses in the housing market sent shares plummeting in recent weeks. Since the beginning of June, Fannie's stock price has dropped 57% and Freddie's plummeted 66%. For the past year, they're both down roughly 85% as of the end of trade on Friday.

Fannie and Freddie guarantee the purchase and trade of mortgages and own or back $5.2 trillion in mortgages.

To help stabilize markets, Treasury Secretary Henry Paulson asked Congress to temporarily empower Treasury to offer the companies a backstop if needed. Consequently the housing bill now includes provisions that let Treasury over the next 18 months offer Fannie and Freddie an unlimited line of credit and the authority to buy stock in the companies.

Both critics and supporters of the Paulson plan have expressed concern that loaning or investing money in the companies could leave taxpayers with a fat bill to pay.

The Congressional Budget Office on Tuesday estimated the potential cost of a rescue could be $25 billion. CBO said there is probably a better than 50% chance that Treasury would not need to step in. It also said there is a 5% chance that Freddie's and Fannie's losses could cost the government $100 billion.