By Huw Jones and Andrew MacAskill

LONDON (Reuters) - Banks from Italy, Ireland, Spain and Austria fared worst in the latest European Union stress test, which the region's banking watchdog said on Friday showed there was still work to do in order to boost credit to the bloc's economy.

Eight years since the collapse of Lehman Brothers sparked a global banking meltdown, many of Europe's banks are still saddled with billions of euros in poorly performing loans, crimping their ability to lend and putting off investors.

"While a number of individual banks have clearly fared badly, the overall finding of the European Banking Authority - that Europe's banks are resilient to another crisis - is heartening," Anthony Kruizinga at PwC said.

Italy's Monte dei Paschi <BMPS.MI>, Austria's Raiffeisen <RBIV.VI>, Spain's Banco Popular <POP.MC> and two of Ireland's main banks came out with the worst results in the EBA's test of 51 European Union (EU) lenders.

"Whilst we recognize the extensive capital raising done so far, this is not a clean bill of health," EBA Chairman Andrea Enria said in a statement. "There remains work to do."

Italy's largest lender, UniCredit <CRDI.MI>, was also among those banks which fared badly, and it said it will work with supervisors to see if it should take further measures.

Germany's biggest banks, Deutsche Bank <DBKGn.DE> and Commerzbank <CBKG.DE>, were also among the 12 weakest banks in the test, along with British rival Barclays <BARC.L>.

Monte dei Paschi, Italy's third largest lender, had been scrambling to pull together a rescue plan and win approval for it from the European Central Bank ahead of the test results.

The Italian bank confirmed less than an hour before the results that it had finalised a plan to sell off its entire portfolio of non-performing loans and had assembled a consortium of banks to back a 5 billion euro capital increase.

The EBA looked at how banks could withstand a three-year theoretical economic shock which ended with the Italian lender, the world's oldest, having a core equity capital ratio of minus 2.44 percent.

This was the third stress test in the EU since taxpayers had to bail out lenders in the 2007-09 financial crisis, with no pass or fail mark this time round. The test involved scenarios including EU economic output 7.1 percent below the baseline over the next three years and a 20 percent drop in interest income.

"Based on these results European banks do have deeper loss absorbing capacity than previously, but concerns clearly remain around profitability and the appetite of equity investors to invest in bank stocks," said Steven Hall of KPMG.

Analysts have informally set a basic pass mark of 5.5 percent, the threshold set in the last round of tests in 2014, and a weak result could raise question marks over dividend payments.

MORE RESILIENT

Like Monte dei Paschi, Allied Irish Banks was also below the 5.5 percent level at 4.31 percent, but said it has undergone fundamental restructuring and is now sustainably profitable.

Markets will also look at how many banks were able to maintain a core ratio of capital to risk-weighted assets of 7 percent. This is a typical level for triggering the writedown of bonds issued by banks to replenish capital.

Spain's Banco Popular, Bank of Ireland and Austria's Raiffeisen all ended the test below this level at 6.62 percent, 6.15 percent, and 6.12 percent, respectively.

"We are aware of our capital situation and have been implementing for some time appropriate measures to strengthen our capital base," Raiffeisen CEO Walter Rothensteiner said.

Popular earlier said that it had fired its chief executive Francisco Gomez after its profit was nearly wiped out in the second quarter. It said the EBA tests had not included the 2.5 billion euro share issue it completed in May to clean up toxic retail assets.

Deutsche Bank and Commerzbank both scored core ratios of below 8 percent, although Deutsche said it was on track to reach at least 12.5 percent by the end of 2018.

Of the banks tested, 37 are based in the euro zone and supervised by the ECB, which said the results reflected progress in repairing balance sheets.

"The banking sector today is more resilient and can much better absorb economic shocks than two years ago," said Daniele Nouy, who heads supervision at the ECB.

At the start of the test, the banks had an aggregate core ratio of 12.6 percent, with all capital requirements factored in. However, this fell to 9.2 percent by the end of the test, a drop of 340 basis points, equivalent to 226 billion euros of capital.

For the first time, the EU test included the impact of conduct risks such as fines and settlements.

EBA said the total hit from conduct costs was 71 billion euros. The largest impact was from credit or losses on loans, totaling nearly 350 billion euros across all the banks tested.

(Editing by Alexander Smith)