It's still early in the fourth-quarter earnings season, but a trend is developing at the nation's banks: Margins are getting squeezed as tight as a drum.

BB&T ( BBT), the nation's 16th-largest bank, is the latest lender to report a sharp decline in its net interest margin -- a measure of the profitability of a bank's investments and lending operation. On Friday, BB&T, a major southeastern bank, said its net interest margin declined to 4.04%, from 4.15% in the year-ago quarter.

A BB&T executive, in a conference call with analysts, says the bank is "disappointed'' in the margin decline. Most analysts and investors don't like to see a bank's net interest margin fall below 4%.

On Thursday, New Jersey-based Commerce Bancorp ( CBH) reported an equally dramatic decline, as its net interest margin fell to 4.16%. Earlier in the week, Buffalo, N.Y. based M&T Bank ( MTB) said it too experienced margin compression in the quarter, as its rate fell to 3.88%.

The squeeze in margins, which is of a greater severity than some bank analysts were expecting, is an indication that the flattening yield curve is starting to hit the nation's banks in their wallets. The yield curve is said to flatten out when the spread between short-term and long-term rates narrows.

For the past few years, many banks feasted on the wide gap between short-term and long-term interest rates, by borrowing on the cheap and reinvesting the money in higher-yielding mortgage-backed securities. On Wall Street, this type of investing is called the carry trade, and it was a big source of income for many banks.

The flattening yield curve also has a negative impact on a bank's lending operation, because there's less of a spread between a bank's own borrowing costs and the interest rate it can charge borrowers. A small spread diminishes the profit opportunities for a bank.

In fact, that's what BB&T says happened to it in the fourth quarter. The bank says its margins got squeezed because its cost of funds is rising faster than its ability to boost loan prices. Bank executives say they expect the margin situation to improve by the middle of this year.

But one bank analyst is warning investors to shy away from small-cap banks until the yield curve begins to widen again.

Piper Jaffray bank analyst Andrew Collins says the flattening yield curve could be especially damaging to banks with a "high concentration of securities as a percentage of total assets.'' These banks are likely to generate "relatively weak'' returns on their securities portfolio, and this undoubtedly will have a negative impact on earnings.

Collins says some potentially vulnerable banks are Investor Financial ( IFIN), Doral Financial ( DRL) and North Fork ( NFB).

For bank investors, margin watching may be the name of the game as dozens of banks begin releasing their fourth-quarter numbers next week.