NEW YORK (Fortune) -- The problem bank list is just about the only part of the industry that's growing right now.

The sector's financial problems, outlined by regulators in excruciating detail on Thursday, could speed a shakeout that already has slashed banks' ranks by almost half over two decades.

"We could end up with a couple thousand fewer banks within a few years," said Terry Moore, managing director of consulting firm Accenture's North American banking practice. "You could say we're overbanked right now."

The Federal Deposit Insurance Corp. said Thursday that U.S. banks lost $3.7 billion in the second quarter. Bad loans are growing faster than institutions are setting aside in reserves for future losses, while total lending has declined for four straight quarters.

The list of troubled institutions -- those deemed to pose at least a "distinct possibility" of failure -- rose by more than a third during the second quarter, to 416. The FDIC doesn't reveal the names of banks on the problem list.

Anticipating rising costs of dealing with troubled banks, the FDIC on Wednesday formalized new rules for private equity firms and other investors buying failed banks. There has been a heavy trade in failed banks lately, given that 81 institutions have been closed in 2009 and dozens more are expected to be shut over the next year.

The quick pace of failures has already rewarded some prescient bankers.

"We were preparing for this moment for maybe two and a half years," said Norman C. Skalicky, CEO of Stearns Bank, a closely held St. Cloud, Minn., institution that has acquired four banks from the FDIC this year. "The biggest mistake we made was not getting ready a year earlier."

Bank failures aren't the only driver of consolidation. While bank mergers fell to 89 in the first half of 2009 from their recent peak of 153 in the first half of 2007, growth-minded banks such as First Niagara (FNFG) in Lockport, N.Y., are looking for opportunities to expand.

"We are always working with our eyes wide open," said John Koelmel, CEO of First Niagara, which last month announced the acquisition of Harleysville National (HNBC) of Philadelphia. "Our shopping cart isn't full."

The shopping spree ahead -- Moore says the U.S. could lose 2,000 banks by the end of 2012 -- is likely to claim some well known regional banks.

Colonial BancGroup of Alabama and Guaranty Financial Group of Texas have failed over the past month. Chicago condominium lender Corus Bankshares (CORS) has been on death watch for some time.

Judging by stock prices, investors are still questioning the prospects of KeyCorp (KEY, Fortune 500) of Cleveland, Marshall & Ilsley (MI) of Milwaukee and Regions Financial (RF, Fortune 500) of Alabama.

But the bulk of consolidation is likely to come at the expense of smaller banks, whose numbers have been dwindling for decades in the face of deregulation and technological advances that disproportionately aided bigger competitors.

The number of banks with less than $100 million in assets has dropped by more than 5,000 since 1992, according to a study released this year by banking consultancy Celent.

Even more pronounced has been the small banks' loss of deposits. Small banks' share of the U.S. deposit market plunged to 2% last year from almost 13% in 1992, according to Celent data.

"The world is only getting more complex," Celent analyst Bart Narter wrote, noting ever-increasing regulatory paperwork and new businesses such as Internet banking. "Small banks are overwhelmed."

That said, small banks aren't going away. Policymakers such as FDIC chief Sheila Bair have emphasized their importance in lending to small businesses, and studies have found they tend to pay better deposit rates than bigger rivals. The FDIC on Wednesday extended a program that some community bankers credit with helping them to compete with the biggest banks.

And the smallest banks have generally performed better during the financial crisis than their bigger rivals. Banks with less than $100 million in assets make up more than a third of the FDIC's problem bank list, but have accounted for just 11 of 81 bank failures so far this year.

Like their bigger rivals, community banks are now enjoying stronger profit margins in the second quarter, as the spread between the rates banks pay depositors and those they charge to lend to borrowers widened.

"This is good news for community banks, since three-fourths of their revenues come from net interest income," Bair said Thursday.