LISBON (Reuters) - Angolan investor Isabel dos Santos and Caixabank (>> CaixaBank SA) clinched a last-minute deal on Sunday for the Spanish bank to buy dos Santos' stake in Portugal's Banco BPI (>> BANCO BPI), which in turn will offload the controlling stake in its Angolan unit.

BPI, Portugal's second-largest listed bank, said in a short statement its two main shareholders "today successfully finalised their negotiations to find a solution to the breach of the large exposures limit" in Angola, and that they informed the European Central Bank and the Bank of Portugal of their deal.

Sunday was the deadline for BPI bank to get rid of its risky Angolan assets before new European rules kick in requiring banks to fully provision for such holdings.

BPI did not provide any details of the deal, saying they would be disclosed in the coming days.

Sources close to the process told Reuters that the deal called for Caixabank to buy dos Santos' 18.6 percent stake in BPI. Caixabank is already BPI's largest shareholder with a stake of 44 percent.

Dos Santos, Africa's richest woman according to Forbes, is the daughter of Angola's long-serving president, Jose Eduardo dos Santos, and has various investments in Portugal.

An initial outline of the deal also envisaged that Unitel, the Angolan telecoms firm dos Santos controls jointly with state oil company Sonangol, would acquire a controlling stake in BPI's Angolan unit BFA, but one source said the final agreement was more complex as it now involved the listing of BFA shares.

Under the deal, BFA is to be listed on the Euronext Lisbon bourse, while Caixabank will have to launch a full takeover bid for the remainder of BPI, sources said.

BPI holds a 50.1 percent stake in Angolan bank BFA, while Unitel owns the other 49.9 percent.

Before reaching the deal, the two parties had been at loggerheads for months after dos Santos blocked the Spanish bank's bid last year for the 56 percent of BPI it did not already own.

(Reporting by Andrei Khalip and Sergio Goncalves; Editing by Peter Cooney)

Stocks treated in this article : BANCO BPI, CaixaBank SA