Senate Democratic and Republican leaders reached agreement Wednesday on a multibillion-dollar package to address rampant foreclosures and other problems stemming from what may be the worst housing slump since the Great Depression.

The compromise measure, placed on a fast track by the election-year desire to mollify voters, could be approved by the Senate as early as this week. It would be the first significant intervention by federal lawmakers to aid victims of the mortgage crisis.

Among the biggest beneficiaries would be home builders and other businesses affected by the housing slump. They would gain the right to charge off losses this year and next against taxes already paid for the four previous years, up from two under current law.

The Senate Finance Committee, which developed that provision, estimated that it would cost more than $6 billion in tax revenues, though others contended the loss to the Treasury could be much higher.

Senate leaders acted after critics drew a stark contrast between the Federal Reserve System's prompt action last month to rescue the investment bank Bear Stearns Cos. and the disjointed efforts by Congress and the White House to relieve the effects of the crisis on individuals.

"We helped Wall Street. We're all glad that Bear Stearns was taken care of," Senate Majority Leader Harry Reid (D-Nev.) said Wednesday after the agreement was announced. "But now it's our opportunity to take care of people on Main Street."

The bill, crafted by Sen. Christopher J. Dodd (D-Conn.) and Sen. Richard C. Shelby (R-Ala.), the Senate Banking Committee's chairman and ranking Republican, respectively, features provisions to aid a long list of those stung by the housing slump. This includes families facing foreclosure, communities fearing a surge in abandoned properties, new-home buyers, returning war veterans, low-income taxpayers and home builders.

But it lacks a provision that many housing experts say could have a broad and positive effect on financially strapped homeowners: permission for bankruptcy judges to modify the terms of mortgages on debtors' primary residences. Such a provision has been sharply opposed by the mortgage banking industry and Republican lawmakers.

Nor does it include a plan, proposed by Rep. Barney Frank (D-Mass.), to grant the Federal Housing Administration expanded powers to back the refinancing of troubled mortgages by providing $300 billion in new loan guarantees. Frank has scheduled a hearing on the bill next week.

Lawmakers acknowledged that Dodd and Shelby's bill was only a first step in addressing the manifold economic issues raised by the housing slump. At a Capitol news conference, Dodd called the bill a "strong beginning" but said more would need to be done.

Among the key provisions of the bipartisan measure is authority for $10 billion in federal tax-exempt bonds that could be used to provide mortgages for low- and moderate-income first-time home buyers and to refinance existing sub-prime mortgages.

The bonds would be issued by state and local housing finance agencies, which under current rules generally can use such tax-exempt bonds only to make new loans to first-time buyers, not to refinance existing loans.

The bill also includes $4 billion in block grants to allow communities hard-hit by foreclosures to buy and rehabilitate vacant or abandoned homes.

The goal is to keep such derelict properties from undermining otherwise stable neighborhoods. Another $100 million will be made available for the counseling of homeowners facing financial distress, which housing advocates say is useful in heading off foreclosures.

The measure includes a tax credit of up to $7,000, spread over two years, for people who buy and move into foreclosed homes, another step aimed at keeping such properties occupied. The panel estimated the cost of the tax credit for people who buy foreclosed homes at $1.6 billion.

Another provision allows taxpayers who do not itemize deductions to claim a deduction of up to $1,000 for property taxes. And the bill increases the length of time a lender must wait before beginning foreclosure proceedings on a home owned by a returning war veteran -- to nine months dating from the veteran's return home from the current three.

The bill is certain to play into the developing debate about the scale and nature of the government response to the housing slump, and about how to balance the interests of borrowers against those of lenders, and of homeowners against home buyers.

To some critics, the decision to leave bankruptcy reform out of the bill amounted to favoring the mortgage industry over borrowers. Under current law, bankruptcy judges have the latitude to adjust the terms of mortgages held by property speculators, but not by homeowners.

Changing that rule would prevent as many as 600,000 foreclosures, according to the Center for Responsible Lending, a nonpartisan group critical of mortgage lending practices. The provision was dropped because of strong Republican opposition, but a number of Democrats have vowed to keep pressing for a change in the bankruptcy law.