Germany, often criticised for its fragmented and weak banks, saw only one small lender fail the exercise while its banks on average slightly outperformed the euro zone average, data published by the European Central Bank showed.

"German banks demonstrated that they are robust enough to withstand even severe stress but have to increase their profitability in order to cross the finish line at the front," Andres Dombret, Bundesbank board member in charge of regulation, told reporters.

In the hardest part of the test, German banks posted an average capital ratio of 9.1 percent compared to a euro zone average came of 8.4 percent.

Mortgage bank Muenchener Hyp [MNCHY.UL] was the only lender to fall short as of the end of 2013 but has since raised 415 million euros (315.09 million pounds) to close its capital gap.

Even HSH Nordbank [HSH.UL], which openly worried about failing the test, cleared the 5.5 percent minimum capital threshold in the hardest part of the test with a score of 6.1 percent, thanks largely to state guarantees.

"The results confirm my impression that German banks have prepared well," said German finance minister Wolfgang Schaeuble.

But while German banks overwhelmingly passed, many of them were borderline. German lenders accounted for seven of the 17 banks with a capital threshold 1.5 percentage points or less in excess of the 5.5 percent pass mark in the stress tests.

Many analysts had expected Germany's lenders to be among the weakest in Europe and some had pointed to Deutsche Bank (>> Deutsche Bank AG), Commerzbank (>> Commerzbank AG) and HSH Nordbank as potentially failing the exercise.

Debt issued by some German public-sector banks - or landesbanks - weakened dramatically as investors feared the sector would fare poorly under the ECB’s rigorous examination.

Germany has 1,813 banking institutions – the most per capita in Europe – and, at above 50 percent, the highest degree of public or cooperative ownership.

Its largely clean bill of health does not mean that the restructuring of the sector since the financial crisis is complete.

"The marathon has only just begun," said Dombret.

German banks' 2013 return on equity of 1.26 percent came in below the European average, he said.

HSH, for example, must still convince European competition regulators that it has a viable business model in order for its state aid package to be approved.

(Reporting by Jonathan Gould, Arno Schuetze and Tom Atkins, editing by Mike Peacock)

By Arno Schuetze and Jonathan Gould