The country's two main lenders, Allied Irish Banks (>> Allied Irish Banks PLC) and Bank of Ireland (>> Bank of Ireland), fared second and fourth worst respectively among 51 banks scrutinised over their ability to withstand a three-year theoretical economic shock.

The two banks suggested they felt they had been unfairly penalised because of the inclusion throughout the three years of costly legacy features from the last crisis that they are shedding or have already gotten rid of, a view backed by most analysts on Monday.

For example, the tests assumed that both banks would carry costly contingent capital notes issued when the state bailed them out throughout the stress period whereas in fact they matured last week.

Nevertheless the tests represent a speedbump to a sector the International Monetary Fund said last week had strengthened significantly through major structural change since leading Ireland into an IMF aid programme in 2013 although faces "very likely" negative effects from Britain's vote to quit the EU.

"Ultimately, Irish banks still need a two to three year clean run at rebuilding and recovering. They are halfway through the process, but need to avoid shocks," said Owen Callan, an analyst at Cantor Fitzgerald.

The 2008 financial crisis, made far more severe in Ireland by a simultaneous property crash, left Ireland's banks with huge stocks of non-performing loans (NPLs) which they have made strides in reducing, in contrast to many of Italy's banks.

Following further declines in the first half of 2016, Bank of Ireland has cut its NPLs by 52 percent from the peak and AIB's larger stock has fallen by 62 percent. With the remainder still high by EU standards, a continued favourable outlook is needed to put more troubled borrowers back on track.

The banks also need time to fix structural deficiencies in their legacy operational set ups, Callan says. This includes reducing costs and boosting fee income and waiting for mortgages tracking the European Central Bank's (ECB) record low interest rate that are no longer sold to expire.

Even after cutting its forecasts last week to take account of major trade partner Britain's decisions to leave the EU, the IMF is expecting the Irish economy to grow by 4.9 percent this year and an average of 3 percent for the five years after that, providing the kind of backdrop the banks need to recover.

FALSE IMPRESSION

The stress tests' adverse scenario, which assumed a collapse in Irish GDP to -0.1 percent this year, -1.2 percent in 2017 and growth of 1.7 percent in 2018, left Bank of Ireland's core equity capital ratio, a measure of financial strength, at 6.15 percent under the Basel III industry rules.

AIB's was lower still at 4.31 percent and despite falling below the 5.5 percent mark the market informally set a basic pass mark, analysts said this would not require the 99.8 percent state-owned bank to raise fresh capital.

"I would absolutely not expect this to result in any capital raise requirement for AIB given the bank has just been allowed return two significant sums of capital to the state over the last eight months," said Davy Stockbrokers' Stephen Lyons.

AIB had flagged ahead of the results the European Banking Authority's assumption that every item on its balance sheet at the end of 2015 would carry through for the next three years and cost it 3 percentage points in capital.

After the test, it said the methodology did not reflect its current improving financial performance and that it had undergone fundamental restructuring and was now sustainably profitable.

Davy said those quirks meant the results created a false impression for Ireland's two big banks and notwithstanding the added risk of Brexit, it sees Bank of Ireland and AIB holding strong fully loaded capital ratios of 13.3 percent and 15.9 percent respectively by the end of 2018.

However it did warn that the results risk hurting market sentiment towards the sector.

Bank of Ireland's shares, down almost 50 percent this year amid a European bank selloff made worse in Ireland by Brexit, were 4.9 percent lower at 0.18 euros by 1240 GMT. AIB is not traded on the main stock exchange.

BREXIT DANGER

The stress test surprise hit as Dublin and its banks grapple with quantifying the risk of Brexit. Ireland's export-orientated economy is more vulnerable than most due to the spillover effects while Irish bank exposure to the United Kingdom accounts for around a fifth of total assets, according to the central bank.

AIB, which makes 10 percent of its income in the UK, said last week that including the impact of a weaker pound, lending in the UK fell 17 percent year-on-year in the six months ahead of June's referendum compared to growth of 8 percent in its larger Irish market.

Bank of Ireland said plans to restart dividend payments next year could be impacted by Brexit and that the economic uncertainty created by the referendum outcome could cut loan growth in a market making up a quarter its income.

Davy and Goldman Sachs said the stress tests presented a further headwind around when the 14-percent state owned bank would become the first Irish lender to reinstate dividends since the crash, another important milestone in the sector's recovery.

While Bank of Ireland said it had not yet seen a definitive Brexit impact, the IMF cautioned that the uncertainty is very likely to have a negative impact through operations in the UK and the effects on Irish firms, in the short term at least.

"The impact could be large, but should still be manageable," the IMF said.

(Editing by Anna Willard)

By Padraic Halpin