All is not well with the Too Big To Fail set.

Four of the biggest U.S. banks failed the latest round of Federal Reserve stress tests, the Fed said Tuesday, meaning they'll have to give up hopes of giving more money to shareholders, and may even have to go hat in hand to those shareholders for more cash.

The Fed's goal is to make sure the banks have enough cash to survive another financial crisis, making it less likely the government has to bail them out again.

The tests seemed fairly rigorous -- arguably more rigorous than other stress tests since the financial crisis. But those tests were based on certain models and assumptions about the strength of bank balance sheets, and as we learned in the financial crisis, models and assumptions can go out the window in a hurry.

For now, the Fed says banks have significantly bigger cash cushions than they did heading into the crisis. Still, the Fed said the financial plans of Citigroup, Ally Financial, SunTrust and MetLife left those banks without enough of a cash cushion to survive a severe economic downturn.

That means Citi, the third-biggest U.S. bank, won't be able to raise its dividend or buy back more of its stock from shareholders without first raising more capital.

Fifteen other banks passed the Fed's test, including the biggest U.S. bank, JPMorgan Chase, which earlier on Tuesday announced it planned to raise its dividend and boost a share-buyback program -- essentially declaring to the world that it had passed the Fed's stress test.

JPMorgan's announcement boosted its stock price and lifted the shares of other banks and the entire stock market -- which apparently assumed that every other bank must have passed the stress tests, too. The Dow Jones Industrial Average finished the day up 217.97 points at 13177.68, its highest close since 2007. The Nasdaq blasted to 3039.88, its first close above 3000 in 11 years.

JPMorgan's announcement also seems to have forced the Fed into hurrying up its own announcement of the stress-test results, which was originally scheduled for Thursday. Update: The Wall Street Journal reports that, in fact, the chain of events was the other way around: The Fed decided to release results two days early because there had been a leak, and JPMorgan jumped the gun on announcing its buybacks and dividend increase because of a miscommunication with the Fed.

The Fed's revelation that Citi and the other banks had failed the stress tests sent the shares of those four banks sharply lower in after-hours trading. Shares of the other 15 banks were flat after hours after jumping in regular trading.

MetLife, in a press release, blasted the stress-test results, arguing it was unfair to compare an insurance company to commercial banks:

"MetLife is financially strong and well positioned for both the current environment and a potential further economic downturn," the company wrote. "We are deeply disappointed with the Federal Reserve's announcement."

Ally Financial, which is majority owned by the U.S. government, said it took issue with some of the assumptions in the Fed's tests, including what it called "dramatically" overstated mortgage losses. "Ally continues to have ongoing constructive discussions with its regulators surrounding these matters, and the company will submit a revised capital plan in the near future," the company wrote. "Further, the Federal Reserve has not objected to the ongoing payments of preferred dividends and interest on the trust preferred securities and subordinated debt."

Citigroup said it would pass the Fed's stress test as long as it doesn't raise its dividends or buy back stock. "In light of the Federal Reserve's actions, Citi will submit a revised Capital Plan to the Federal Reserve later this year, as required by the applicable regulations," Citi wrote. "The Federal Reserve advised Citi that it has no objection to our continuing the existing dividend levels on our preferred stock and our common stock, and we plan to do so, subject to approval by the Board of Directors each quarter."

The Wall Street Journal's Deal Journal blog is compiling the responses of the other banks -- so far SunTrust has not yet responded.

Meanwhile, the major banks that passed the stress tests hustled to tell the market they planned to do shareholder-friendly stuff like raising dividends and buying back shares. Goldman Sachs, for example, said it plans to buy back stock and might raise its dividend. Wells Fargo plans to raise its dividend to 22 cents from 12 cents a share.

The Fed tested bank capital-management plans under a set of extreme economic conditions, including 13 percent unemployment, a 50 percent collapse in the stock market and a new 21 percent drop in home prices. The goal was to see how well banks were prepared to survive another crisis like the one in 2008.

The Fed's previous round of stress tests were arguably not all that stressful, allowing some big banks to give money back to shareholders over the objections of then-FDIC chair, Sheila Bair, ProPublica has reported.

Jesse Eisinger, the author of that report, pointed out that SunTrust passed last year's stress test, over Bair's objections. SunTrust failed the latest test.

The latest round of stress tests at least appears to be somewhat more deserving of the name. Citi's failure comes as a particular surprise. Market hopes had risen lately that the bank would get the Fed's OK to raise its nominal dividend of a penny per share.

In contrast, Bank of America, which has more famously been saddled with bad mortgages after its purchase of Countrywide during the financial crisis, passed the stress test. A year ago, the Fed rejected its request to raise its dividend. This year it did not ask.