The U.S. units of two foreign banks -- Deutsche  (DB - Get Report)  and Banco Santander (SAN)  -- once again failed Federal Reserve stress tests, and investment bank Morgan Stanley (MS - Get Report)  received only a conditional pass, meaning it must resubmit its capital distribution plan by the end of the year.

The assessment of 33 large financial institutions, known as the Comprehensive Capital Analysis and Review, is vital for banks because it determines whether they can proceed with their dividend and stock-buyback plans for the next 12 months. 

The two-part review is designed to ensure the biggest banks, with more than $50 billion in assets, have sufficient capital buffers to survive a crisis similar to the 2008 economic meltdown. This year's tests use economic modeling to predict how they would fare during a hypothetical "deep and prolonged" recession in which unemployment peaks at 10% in the middle of 2017 and equity prices fall by about 50% through the end of this year.

In addition to the two banks that failed, a number of other institutions, including State Street (STT - Get Report) and Bank of New York Mellon (BK - Get Report) came close to dropping below minimums. Also, M&T Bank (MTB - Get Report) had to resubmit a less ambitious capital distribution plan after its initial program of buybacks and dividends failed.

The Fed raised serious concerns about Morgan Stanley, telling the firm to address "weaknesses in its capital planning"and  shortcomings in its "scenario design practices," which regulators argued didn't adequately reflect risks and vulnerabilities specific to the firm. The Fed also noted weaknesses in some areas of governance and control.

Morgan Stanley was also among the worst performers in the first portion of the annual review, which was released last week. It had a leverage ratio of just 4.5% on this test and 4.9% in the earlier test, which evaluated existing strength as opposed to prospective viability, both just up from a 4% minimum.

Last year, Morgan Stanley had a leverage ratio of 4.7%, also cutting it close to the minimum. "We didn't want to wait a year to see if they were remediated. We wanted those remediated in a shorter time frame, six months," said a senior Federal Reserve official.

In addition, the Fed said that even though the largest banks have improved in a number of qualitative areas, they also had weaknesses in their internal audit programs for capital planning. Many big banks continue to fall short of expectations to identify risk and setting up internal controls, the regulator said. "These are some clouds they have had difficulty getting above," said a Fed official.

After M&T Bank revised its capital distribution plan, it had a Tier 1 capital ratio of 6.2%, just above a 6% minimum. A number of other banks barely passed the examination.

State Street (STT - Get Report) had a 4.3% Tier 1 leverage ratio, just up from the required 4% and Bank of New York Mellon barely skirted by, with a leverage ratio of 4.6%.

BMO Financial (BMO - Get Report)  had a 6.4% tier 1 capital ratio, just above a 6% requirement, and a 4.9% leverage ratio, just above the 4% requirement.

Comerica  (CMA - Get Report) , which has had trouble with oil and gas loans amid plummeting energy prices, had a 6.8% Tier 1 capital ratio, just above the 6% minimum. Huntington Bancshares  (HBAN - Get Report) , which didn't do so well in the preliminary test, also eked by with a 6.9% Tier 1 capital ratio.

Finally, Zions Bancorp, (ZION - Get Report) a perennial poor performer, attained an 8.9% total capital ratio, just up from an 8% minimum.

Among the most improved firms was Bank of America  (BAC - Get Report)  , was near failing in last year's tests, released in March. This year, it was well above the minimums needed to complete its distribution plan.

In addition, the Fed said the U.S. units of Deutsche Bank and Santander failed on qualitative grounds because of "broad and substantial weaknesses around their capital planning processes."

Both Deutsche Bank and Banco Santander failed the test in 2015 as well, on qualitative grounds. Banco Santander also failed in 2014 due to problems with governance, internal controls, risk management and information systems.

The Fed said that both firms have made "insufficient progress" towards correcting those weaknesses and meeting supervisory expectations. Neither firm has U.S. capital distribution plans. 

Two banks with foreign parents that underwent the tests for the first time this year, TD Group, which is owned by Toronto-Dominion Bank (TD - Get Report) and BancWest, a unit of Paris-based BNP Paribas, didn't have any trouble meeting regulatory minimums, though this year's review is considered to be one of the toughest in recent years.

A major reason is that the hypothetical increase in the unemployment rate to 10% -- an increase of five percentage points by the middle of 2017 -- in the severely adverse scenario is much greater than the hike experienced in scenarios the Fed developed in previous years.

For example, in the 2015 test, the unemployment rate only increased by 4 percentage points to 10% by the middle of 2016. In addition, the scenario this year considered negative interest rates, which may have a tougher impact on banks without major trading operations, for the first time.

Still, all 33 banks came in above required minimums on the first half of the review, results of which were released Thursday.

While Federal Reserve Governor Daniel Tarullo earlier this month said that the eight largest U.S. financial institutions, known as "Globally Systemically Important Banks" or G-SIBs, will need to hold significantly more capital than they currently do as part of future stress tests, that requirement is unlikely to be in place in time for next year's tests.

The affected companies would be Bank of America, Citigroup, Wells Fargo (WFC - Get Report) , JPMorgan Chase  (JPM - Get Report) , Goldman Sachs (GS - Get Report) , Morgan Stanley, Bank of New York Mellon and State Street.