The credit crisis is tightening the screws on thousands of small to midsize banks across the United States, squeezing local builders and businesses that depend on those lenders for financing.

Losses are mounting so rapidly at some of these banks that a small number of them, perhaps 50 out of the 7,500 nationwide, could fail over the next 12 to 18 months, analysts said. Some of the others are likely to shut branches or seek out mergers as the weakening economy strains their finances.

Small lenders are in far less danger than they were during the 1980s and early 1990s, when roughly 1,600 federally insured institutions failed during a savings and loan crisis. And unlike many bigger banks, they shied away from complex mortgage-linked investments and subprime home loans.

But the breadth and depth of the current troubles have caught bank executives by surprise.

Federal regulators are particularly concerned about the exposure of smaller banks to the commercial real estate market, which has begun to soften in some parts of the country.