LISBON, Portugal (AP) — Two of Spain’s biggest banks said Friday they were merging, pushed together by a need to weather tough economic times that likely will cost thousands of jobs.

The tie-up between CaixaBank and Bankia will create the largest lender in the country, with assets of more than 664 billion euros ($787 billion).

The deal comes as Europe’s financial sector braces for lean times. With banks’ profitability in recent years already dented by low interest rates, which squeeze their profits on loans, they are battling a steep economic downturn as well as uncertainty about the future due to the coronavirus pandemic and the United Kingdom’s departure from the European Union.

The deal requires approval by shareholders and regulators, and is expected to be concluded in the first quarter of next year. The Spanish government had welcomed the possibility of a merger, saying the sector needs to become stronger through consolidation.

The banks expect to make annual savings of 770 million euros ($912 million) as they seek economies of scale and further development of online banking. Those policies are expected to bring layoffs among the combined staff of 50,000, though the statement made no mention of job cuts.

The banks’ officials said it was too early to predict how many jobs might be lost.

Bankia president José Ignacio Goirigolzarri told a news conference in Valencia, in northeastern Spain, the merger offered staff the possibility of career growth within “a culture of scrupulous meritocracy.”

“This is a time of disruption, and it’s at these times that opportunities arise and a swift response is needed," he said.

Shares in Caixabank were down 1.5% and Bankia dropped 4% in morning trading, while the main stock index in Madrid was 1.5% lower.

Caixabank will have 74.2% of the new company, which will be called CaixaBank. Bankia will hold 25.8%.

CaixaBank S.A. is one of Spain’s big three banks, along with Santander and BBVA. It has more than 35,700 staff and almost 4,600 offices.

With some 15.6 million customers, Caixabank has more than 44% of the business market involving companies invoicing up to 100 million euros ($118 million) a year. It reported a profit of 1.7 billion euros ($2 billion) last year.

Bankia S.A. was created in 2010 by the merger of seven regional Spanish savings banks as a way of surviving the then financial crisis. It is Spain’s fourth-largest bank by assets.

Following a 2012 government bailout, 61.8% of Bankia’s shares are held by the state, with the rest traded on the stock market. It has around 15,600 staff and last year posted a profit of 541 million euros ($638.5 million).

Santander and BBVA have bigger international operations than CaixaBank.

Copyright 2020 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed without permission.