By David Henry

New York (Reuters) - U.S. units of Deutsche Bank <DBKGN.DE> and Santander <SAN.MC> suffered the ignominy of failing U.S. stress tests yet again this year, less than a week after Britain's shocking vote to leave the European Union sent their investors running for cover.

Santander's U.S. bank is the first to fail the test three years in a row.

Both banks failed because of poor risk management and financial planning, not for lack of capital, the Fed said.

Santander's Chairman Ana Botin vowed in January to fix it within two years, after which she would consider selling it.

Yet any disposal will be tough while the Fed's standards are unmet, meaning Santander cannot access the capital to invest in its bigger businesses in Spain, Brazil and Britain. And it cannot even draw a dividend from the unit in the meantime because of Fed stipulations.

Santander's U.S. unit operates a retail and commercial bank with 670 branches and 9,800 employees in the northeast part of the country. It also owns nearly 60 percent of publicly traded lender Santander Consumer USA Holdings Inc <SC.N>.

Santander said it is fixing the problems and is already preparing for next year's test when it expects the Fed to take a better view of the quality of its management.

"We are well on our way to making the enhancements necessary to improve our qualitative assessment,” Scott Powell, the chief executive of Santander Holdings USA, said in a statement.

The Fed faulted Santander for, among other things, not using "reasonable or appropriate" assumptions and analysis in its capital planning.

But the Fed also said Santander has made "progress in improving certain approaches to loss and revenue projection." And, a senior Fed official said bank supervisors "have noticed a difference" in the resources that Santander has committed to correct the problems.

Santander hired Powell, a former JPMorgan banker, last year and is investing about $170 million a year to reorganize a complex structure, partly a hangover from the acquisition of Sovereign Bank in 2009. Powell is one of more than half a dozen executives hired in the past 18 months to fix the bank.

The Deutsche Bank unit that failed, Deutsche Bank Trust Corp, is one of a handful of entities the company has in the U.S. and holds transaction banking and wealth management business.

The unit is being consolidated into a holding company, DB USA Corp, on July 1 as part of new rules that require large overseas lenders to organize themselves as holding companies in the United States. Deutsche Bank Trust Corporation had not asked for permission to return capital to its parent, a bank spokesman said.

The Fed said the Deutsche unit showed "some improvements in certain aspects of capital planning," but that "the firm overall continues to have material unresolved supervisory issues that critically undermine its capital planning process."

The trouble the two banks are having passing the tests come amid other problems.

Santander's capital ratio is lower than many of its large European peers, though it had reported an improvement in April and forecast that its tier 1 capital ratio under the strictest criteria would rise above 11 pct by 2018.

But since that forecast, Santander's large UK business was hit by that country's decision to leave the European Union and the resulting fall in sterling. Santander shares have dropped 18 percent since the vote and are down 24 percent so far this year.

The economic malaise facing Brazil has also cast a cloud over Santander's Latin American operations. Brazil is battling its deepest recession in decades.

Deutsche Bank, which has trailed its rivals in bouncing back from the 2008 financial crisis, is in the midst of a strategic overhaul.

Germany's largest lender, Deutsche has a large investment banking operation in London. Like rivals it faces the risk of a loss in revenue should Britain's exit from the EU deter companies in Europe from buying assets and issuing debt and equity.

Deutsche may also have to spend and disrupt staff to shift some operations out of the UK if Britain loses the right to sell financial services seamlessly across Europe.

Shares of Deutsche have dropped 19 percent since the UK vote and are down 44 percent since the start of the year.

(Editing by Bernard Orr)