Out of the 37 billion that the Bank of Spain announced Wednesday would be transferred to prop up the ailing Spanish banking system, it appears that, ironically, the most complicated discussions were about the first 1.

Both the Spanish central bank and the European Union announced Wednesday the details of the financial sector rescue, which will transfer 17.96 billion to troubled Bankia S.A. and 14.51 billion to CatalunyaBanc and NCG Banco, two of the other nationalized Spanish banks.

The plan also gives 4.5 billion to Banco de Valencia, the fourth government-owned entity, and holds the Spanish central bank liable for nearly three-quarters of all future losses arising from that institution's liabilities. But in order to make that provision work, the Spanish government had to arrange the sale of Valencia to a third party, Caixabank, for 1.

After months of negotiations, that was all squared away Tuesday, leaving the door open for the deal announced Wednesday.

"The approval of the restructuring plans of BFA/Bankia, NCG, Catalunya Banc and Banco de Valencia is a milestone in the implementation of the Memorandum of Understanding between euro area countries and Spain," EU Competition Commissioner Joaquin Almunia said, referring to Spain's euro zone bank bailout.

"What we've approved today means that the funds for the European Stability Mechanism can be disbursed," Almunia told a news conference.

Not everyone was applauding the announced step. As part of the rescue, hundreds of branches at the nationalized institutions would be closed, leaving thousands of employees out in the cold.

Hybrid and subordinated bondholders -- many small retail costumers of the bank that were sold those products as supposedly safe investment options -- would see a restructuring of their claims as part of the deal, something that the EU estimated would cost them 10 billion. Anonymous sources told Reuters other debtholders could see losses of 10 to 50 percent the value of their bonds.

Bankia, the largest and most trouble of the government-owned banks, would seek to lose 6,000 employees and return to profitability by this time next year.

The focus on putting the banks on solid financial footing, even if it meant pulling the livelihood away of thousands of Spanish professional, was not well received in a country that already has unemployment levels of more than 25 percent. A spokesman for one of the country’s largest trade unions told the Wall Street Journal it would not support the planned dismissals, calling the layoff plans “a terrible blow” that sets the banking sector “on an uncertain path.”

Indeed, it wasn’t sure the new plan had set Spanish banking on a path toward a clean bill of health. The International Monetary Fund said in a report on Spain's banking system Wednesday that it is "essential to assess carefully whether restructuring plans have any systemic implications for credit supply,” suggesting further steps might need to be taken.

The news had little effect on the Spanish equity markets, with the benchmark IBEX 35 Index falling just 0.33 percent.