Image copyright Getty Images

Nearly all large US banks have passed the Federal Reserve's annual stress test, with only US units of Deutsche Bank and Santander failing.

The test is designed to judge whether banks operating in the US can weather a major economic downturn.

Santander Holdings and Deutsche Bank Trust Corp had already failed last year.

The Fed said that "broad and substantial weaknesses" persisted in the banks' capital planning.

While all 31 large US banks passed the test, Morgan Stanley only got conditional approval and has to submit a new capital plan by the end of the year.

For Germany's Deutsche Bank it was the second year that the subsidiary of the German lender failed the test while for Spain's Santander it was the third time.

While the Fed noted improvements for the two banks, the regulator said there were continued substantial weaknesses.

The annual test looked at the 33 biggest banks in the US to see how they would be able to keep operating even in a severe financial crisis and economic downturn.

The tests were launched in the wake of the 2008 financial crisis.

Raising dividends

Banks that pass the test are effectively getting a green light to raise dividends or repurchase shares.

But these returns to investors cut into a banks' capital reserves, and can make firms more vulnerable during an economic downturn.

Therefore, regulators like the Federal Reserve want to keep check on whether or not a bank is permitted to raise its dividend.

"The participating firms have strengthened their capital positions and improved their risk-management capacities," Fed Governor Daniel Tarullo said. "Continued progress in both areas will further enhance the resiliency of the nation's largest banks."