"This acquisition has a lot of financial logic, we're talking about two institutions that complete each other perfectly," CEO of Caixabank, Gonzalo Cortazar, told a news conference, adding that the Portuguese market "has potential".

The takeover took nearly two years to complete and was designed to boost Caixabank revenues outside Spain, where it faces stiff competition for lending. The Barcelona-based lender was one of Spain's most acquisitive banks during the financial crisis, and has struggled to offset falling profitability at home by buying smaller savings banks.

It launched its first bid for BPI in 2015 at 1.329 euros per share, but opposition by some shareholders, notably Angolan investor Isabel dos Santos, forced it to withdraw that bid last year, only to make a lower final offer of 1.134 euros a share.

Dos Santos, the daughter of Angola's president, had a stake of about 20 percent in the Portuguese bank. It was not immediately clear whether she was fully bought out.

BPI CEO Fernando Ulrich will step down, but Caixabank proposed that he be elected chairman of the board at BPI, which will keep its decision-making centre in Portugal.

Caixabank has said it expects savings of up to 84 million euros a year from merger synergies, including up to 45 million euros from 900 layoffs as businesses are combined.

Caixabank ended 2016 with a fully-loaded capital ratio - a measure of a bank's strength under the strictest capital rules - of 12.4 percent and expected the ratio to fall by up to 80-140 basis points, depending on the take-up of the BPI bid.

Although not immune to problems affecting Portugal's notoriously fragile banking sector, BPI has long finished paying off its state loans, while its larger rivals Millennium bcp (>> B. COM. PORTUGUES) and state-owned CGD still owe money to the state.

BPI had a 33 percent rise in 2016 net profit as net interest income rose while impairments for bad loans fell sharply. Its fully-loaded capital ratio at the end of 2016 was 11.1 percent.

Before the completion of the takeover, BPI handed control of its lucrative Angolan unit BFA to Angolan telecoms firm Unitel to meet requirements by the European Central Bank on risky exposure to the Angolan economy.

Dos Santos also indirectly controls Unitel and the BFA deal was seen as a way of winning her approval for the takeover.

Shares in BPI closed 6.58 percent lower before the announcement, on expectations it would drop out of Lisbon's PSI20 leading stock index. Caixabank shares fell 1 percent.

($1 = 0.9356 euros)

(Writing by Andrei Khalip; Editing by Ruth Pitchford)

By Sergio Goncalves

Stocks treated in this article : B. COM. PORTUGUES, BANCO BPI, CaixaBank SA