MADRID, May 23 (Reuters) - Spain's Unicaja expects a gain of 318 million euros ($339 million) from the sale of a controlling stake in its pension and reinsurance business after the extension of an alliance with insurer Santa Lucia, the bank said on Monday.

Following Unicaja's acquisition of Liberbank, closed in July, Santa Lucia is expected to buy 50% plus one share of Unicaja's CCM Vida y Pensiones de Seguros y Reaseguros, formerly owned by Liberbank.

The deal is pending regulatory approvals and the end of Unicaja's tie-ups with insurance company Mapfre, and with the reinsurance business of Aegon Spain, it said.

Unicaja will hold the rest of this business unit and extend its bank assurance agreement with Santa Lucia in certain areas such as savings, life risk and pension plans.

The lender will also be entitled to receive a variable amount of up to 40 million euros, depending on the performance of certain business objectives over the next 10 years.

Once completed, the deal is expected to have a total positive impact of around 20 basis points on Unicaja's core Tier-1 capital ratio, excluding the variable payment.

($1 = 0.9371 euros) (Reporting by Jesús Aguado; editing by Andrei Khalip)