By Jesús Aguado

MADRID (Reuters) -Caixabank has agreed with unions to lay off 6,452 employees in what will be the biggest ever staff overhaul in Spanish banking, even after the lender shaved 1,800 cuts from its initial plans, the bank and a union spokesperson said on Thursday.

The agreement to reduce its workforce in Spain by around 14.5% was reached after the bank met some of the union's demands, such as voluntary redundancies rather than compulsory cuts, Comisiones Obreras (CCOO) union and the bank said.

The deal was also made possible after improving financial compensation for those who leave the bank, a spokesperson for the union added.

In April, Caixabank had announced plans to cut 8,291 jobs, one of the largest such culls in Spain's corporate history, and close 1,534 branches, slightly more than a quarter of its offices, to adapt to a customer shift towards online banking.

Caixabank in March closed the acquisition of Bankia to become the country's biggest domestic lender in terms of total assets. It estimated that layoffs would cost 1.9 billion euros ($2.25 billion).

It also said the extraordinary gross charge would have a negative impact of 90 basis points in its reported core tier-1 capital as of end of March and that costs and capital impact would be fully booked in the second quarter of 2021.

The bank also said it would reduce the number of branches affected to around 1,500.

The bank has around 5,550 branches and 44,400 staff in Spain.

The agreement with the union is a key aspect of the Bankia deal, which is underpinned by annual cost savings of 770 million euros ($916 million) by 2023. Caixabank said the agreement would save at least this amount..

It said it would provide further details at the upcoming second quarter results presentation.

($1 = 0.8440 euros)

(Reporting by Jesús Aguado; Editing by Kirsten Donovan and David Gregorio)