An independent “stress test” of the Spanish banking system met expectations Friday afternoon, providing a breather to panicked financial markets, which had sold off earlier in the day on expectations of a nasty surprise.

An assessment of the capital position of major Spanish banks by private consultancy Oliver Wyman found Iberian banks had a capital hole of €59.3 billion ($76.2 billion). That number is both much worse than had been expected just a few months ago, and much better than the market’s worst fears.

In June of this year, Oliver Wyman and Roland Berger, another private firm, had reported they expected Spanish banks would need to recapitalize to the tune of between €16 billion and €25 billion. Under the worst-case scenario, the auditors had then said up to €62 billion would be required.

Since then, the worst-case scenario has come to pass, with Spain seeing a slow-motion bank run, default rates on mortgages rising, a consumer recession, unemployment deepening and bank profits tanking in the second quarter.

Rumors early Friday suggested the banks would need as much as €165 billion and that the Oliver Wyman report would be quickly followed by a sovereign downgrade of Spanish debt.

The fact the figure was not so high is important. In June, following the revelation of an accounting scandal at nationalized lender Bankia, Spain negotiated a €100 billion European bailout for its banks. Experts assume banks will begin to receive funds from that rescue as early as November.

Bankia, at the center of the horror in Spanish banking all year, was also at the top of banks needing additionally capital, with an estimated €24.7 billion shortfall, after tax credits are taken into account. Six other banks were also seen as requiring additional capital, including large Banco Popular, the sixth- most important in Spain, which was reported as having a €3.2 billion need.

Banc Sabadell, the fifth-largest banking group, was reported as not requiring additional capital, a positive surprise. Both Banco Santander, S.A. (NYSE:SAN) and Banco Bilbao Vizcaya Argentaria SA (NYSE:BBVA), the largest multinational banking groups in Spain, are seen as well-capitalized.

'In the Middle of the Crisis'

Fernando Restoy Lozano, vice-governor of the Bank of Spain, who presented the report at a press conference, noted the numbers tabulated in the stress test take into account a pessimistic, adverse case that assumes the Spanish economy gets much worse, losing 2.1 percent in GDP next year, unemployment rising to near 27 percent and assuming sovereign borrowing costs that balloon near 8 percent. (Currently, the government expects Spanish GDP to contract by 0.5 percent and unemployment to stall at 24.6 percent in 2013.)

“We’re taking into account the loss ratios we’re seeing right now, in the middle of the crisis,” Restoy noted.

Indeed, the “adverse scenario” sees the percentage of performing loans that suddenly go into default more than doubling before 2014.

Restoy also emphasized that “the numbers we have calculated will not coincide with the volume provided through public aid,” since banks would be able to recapitalize by selling off assets, cancelling dividend payments or raising funds in the private market. The government believes it will need to provide, at most, €40 billion in capital. Adding credence to this point, Banco Popular said Friday it would plug its capital hole without requiring government aid.

The fact that government aid for other banks will be needed, however, is uncontested. One thing that Restoy did table: the possibility his central bank would attempt to have banks plug their capital shortfalls through government-brokered shotgun mergers.

Speaking of such a strategy, which was preferred by U.S. Treasury officials when dealing with the seeming collapse of the American financial system in late 2008, the central banker noted: “We are not going to go the way of taking two weak entities to try to merge them into a stronger one. We believe this is a mistake, and we are not going down this route.”

Government officials also discarded the idea, highly popular in Spain at the moment, of using the difference between the funds provided by European partners and those required by banks to stimulate the wounded Spanish economy.

“The available financing is set to fill the needs of the financial system. As such, it would not be proper to use them to other ends,” Fernando Jiménez Latorre, Economy Ministry undersecretary in charge of the economy and business support, said.

“A major step”

The financial markets reacted positively to the release of the report. While European stock exchanges were closed for the week at the time the “stress test” results were announced, New York-listed shares of both Banco Santander and BBVA, which had dragged over 3 percent in the morning session, quickly pared their losses.

Not all the details of the report were positive, however. For example, a major pitfall identified by the auditors noted banks examined had dressed up certain nonperforming assets through restructuring and had “misclassified real estate developer loans under other corporate segments,” a bookkeeping error that could explode in a cascade of defaults in the near future.

Still, optimism from European and Spanish officials seemed to carry the day.

In a statement, the European Commission noted the release of the report was “a major step in implementing the financial-assistance programme and towards strengthening the viability of and confidence in the Spanish banking sector.”

Christine Lagarde, IMF managing director, said she strongly supported “the authorities’ commitment to ensure that capital needs are met in a timely manner and that the weakest banks are dealt with effectively.” The European Central Bank and the European Banking Authority also issued congratulatory notes.

“As a result of the whole restructuring and consolidation process, we are convinced we will have a more solid, efficient and profitable banking system that will contribute to the health of the Spanish economy,” Restoy, the Spanish central banker, said.