The sale includes Barclay's retail banking, wealth and investment management and corporate banking businesses in Spain.
In a statement, Barclays said 2,400 staff and 262 branches would transfer to CaixaBank once the deal is completed, likely around the end of the year.
The British bank is undertaking a major restructuring to shrink its operations that is expected to see 19,000 jobs axed across the group over the next two years.
Barclays said it had also completed the sale of its United Arab Emirates retail banking business to Abu Dhabi Islamic Bank for £119 million ($197 million, €150 million).
"I am pleased to be announcing further progress on Barclays Non-Core asset reductions through the transactions announced today. We remain on track to rebalance Barclays as part of our strategy to deliver sustainable returns for our shareholders," said Barclays Group chief executive Antony Jenkins.
"I want to take this opportunity to thank our colleagues in the Spanish Retail Banking, Corporate Banking and Wealth and Investment Management businesses, as well as our Retail Banking colleagues in the UAE, for their hard work and professionalism over many years."