Madrid (AFP) - Hit by a severe crisis several years ago, Spain's banking sector has recovered but at a cost as thousands are laid off and it struggles to get rid of toxic assets.
"The system is closer to putting most of the crisis legacies behind it," analysts at the International Monetary Fund in charge of Spain said in a recent report.
Still, the ghosts of a crisis that saw the European Union bail out the sector have recently been revived as Italy suffers a similar predicament, with the state having to rescue Monte dei Paschi di Siena, the world's oldest bank.
The EU lent 41 billion ($43 billion) euros to rescue the Spanish banking sector in the spring of 2012, compared to some 50 billion euros in Greece, as an example.
At the time, Spain was waist-deep in a financial crisis caused when a property bubble burst in 2008 after years of euphoria that saw loans granted almost blindly to households incapable of reimbursing them.
- Bad debt down -
Since then, though, the share of problem loans in the balance sheets of Spain's banks has dropped considerably.
In the second quarter of 2016, it stood at an average of 6 percent, according to the European Banking Authority (EBA) regulatory agency.
This is slightly above the European median of 5.4 percent, but well below that of Italy, Portugal or Greece, which stands at 16.4, 20 and 47 percent respectively.
Spain's central bank, which is even stricter in its calculations of the share of bad loans, said in November that it stood at an average of 9.2 percent, against a high of 13.6 percent at the end of 2013.
The Moody's ratings agency predicts this should continue to drop thanks to "favourable macroeconomic conditions" such as expected growth of 3.2 percent in 2016, double the eurozone average.
Banks are also much stricter in granting loans now.
But on a darker note, they are struggling to sell the huge amount of property seized during the crisis from households that could not pay, as buyers remain scarce.
"Despite the mild recovery in the housing market observed in 2015, banks' real estate repossessions continue to exceed the volume of properties that banks manage to sell," Moody's said in a note.
The agency values the amount of "problematic" assets still in banks' hands at 350 billion euros.
- Concerns over Brexit, Trump -
But Nuria Alvarez, an analyst at Spanish brokerage Renta 4, says banks have managed to bolster their liquidity and capital to face any potential problems down the road.
As such, in the last resistance tests done by the EBA, Spain's large banks fared well.
The sector also turned to foreign markets to survive.
"International diversification... no doubt helped digest the recent crisis," financial consultant Daniel Manzano wrote on his blog.
According to Manzano, 42 percent of the sector's turnover comes from outside Spain, double the amount before the crisis.
There too, though, there are dark clouds.
Brexit for one has caused concern, as Spain's biggest bank Banco Santander has a huge presence in Britain.
Donald Trump's election to the US presidency has also sparked fears due to the strong presence of BBVA, Spain's second-largest bank, in Mexico, with whom the billionaire has a tense relationship.
As with everywhere else in Europe, much of the concern also comes from lacklustre profitability due to low interest rates.
According to BBVA Research, the sector's gross margin fell 7 percent year-on-year in the first nine months of 2016.
To reduce costs, the sector has let thousands go, just as people resort more and more to online banking rather than physical agencies.
Over the past seven years, 27 percent of jobs -- or 75,000 posts -- and 36 percent of agencies have been cut, the research group says.
In 2016, Banco Santander and CaixaBank both launched voluntary redundancy and pre-retirement schemes.
This will "continue" this year, predicts Alvarez, but likely at a slower rate.
And in the medium-term, mergers could also be on the cards.