Barclays has agreed to sell a part of its Spanish business to Barcelona-based Caixabank for £633m, as the British lender starts scaling down its presence in less-profitable markets as part of a major overhaul.
The sale includes Barclays' retail, wealth management and corporate banking units in Spain.
The deal does not include Barclays' investment banking and credit card divisions in the country, according to announcements by both banks.
Barclays also said it will make about a £500m ($830m, €632m) loss after tax on the transaction, with £400m to be reported in the third quarter of 2014.
Barclays said in a statement: "On completion, approximately 2,400 Barclays employees and 262 branches will transfer to CaixaBank. Completion is subject to, amongst other things, regulatory approvals and is expected to occur at or shortly after the year-end."
Barclays Group Chief Executive Antony Jenkins said: "...We remain on track to rebalance Barclays as part of our strategy to deliver sustainable returns for our shareholders..."
Spain's third largest lender, Caixabank said in a statement: "As a result of this transaction, CaixaBank will consolidate its leadership in Spain, gaining approximately 550,000 new customers, mainly from the retail banking and private and personal banking divisions..."
As part of the group's strategy of moving more towards High Street than Wall Street, Barclays confirmed in May 19,000 job cuts over the next three years along with the restructuring of a number of units.
Barclays shut or sold 161 branches in Spain in 2013, trimming its network by over a third to 270 branches.
As many as 14 branches were acquired by local savings bank Caja Rural Castilla-La Mancha in October 2013.
Barclays' European retail business has lost about £2bn ($3.4bn, €2.5bn) over the past four years.
Barclays entered Spain with the €1.1bn purchase of Banco Zaragozano in 2003, but ran into problems from huge losses on corporate loans and the recession.