WASHINGTON  Hoping to stretch a safety net under the nation’s tumbling housing market, the Senate on Saturday overwhelmingly approved a huge package of legislation that includes a program to save hundreds of thousands of families from losing their homes to foreclosure.

The legislation is the latest in a series of extraordinary interventions this year by the Bush administration, Congress and the Federal Reserve as they seek to limit shockwaves in the housing sector from rippling across the American economy and the world financial system. In the process, the central bank and taxpayers have taken on what critics warn are incalculable liabilities and risk.

The bill grants the Treasury Department broad authority to safeguard the nation’s two mortgage finance giants, Fannie Mae and Freddie Mac, potentially by spending tens of billions of dollars in federal money to prevent the collapse of the companies, which own or guarantee nearly half of the nation’s $12 trillion in mortgages.

To accommodate the rescue plan for the mortgage companies, the bill raises the national debt ceiling to $10.6 trillion, an increase of $800 billion and the first time that the limit on the government’s credit card has grown to 14 digits.