UPDATE 3-Piraeus in deal to buy Greek units of Cypriot banks
* Bailout proposal spared Greek units from levy if sold
* Piraeus wins race to buy Cypriot bank units
* Athens determined to reopen banks Tuesday - sources
* European shares pare losses, Piraeus shares up 20 pct
By George Georgiopoulos, Lefteris Papadimas and Laura Noonan
ATHENS/NICOSIA, March 22 (Reuters) - Greece's Piraeus Bank struck a deal on Friday to take over the Greek branches of Cyprus's troubled banks in what a source close to the matter said involved the transfer of 17 billion euros of loans and 14 billion euros of deposits.
Piraeus was chosen in a deal that helps to shield Greek banks from the island's crisis and allows Cyprus to shrink its bloated banking sector.
The deal, announced by Greece's bank bailout fund, is subject to approval by European competition authorities. The terms of the deal will not be revealed until Sunday, the source said. Piraeus declined to comment.
The fund did not provide further details but officials said that Piraeus, Greece's third-largest bank, beat out Alpha Bank in the race for the Greek units of the two biggest Cypriot lenders - Bank of Cyprus and Cyprus Popular Bank.
Piraeus shares closed up 20 percent after news of the deal, which was first reported by Reuters.
The two countries earlier announced the units would be sold to a Greek lender as cash-strapped Cyprus scrambles to strike a bailout deal to avert a collapse of its financial system.
Worried the crisis could trigger panic among Greek savers, Greek officials had been trying to agree a deal since early this week but were forced to put the plans on hold after Cyprus voted down an unpopular bank levy included in its bailout agreement.
"We have responded to the necessity of utterly safeguarding the depositors of the Cypriot banks in Greece," Piraeus Chairman Michalis Sallas said.
A senior Greek official said the deal would "be good because it will ringfence the Greek banking system".
European shares pared losses after news of the agreement between the two nations, which fulfils one term in the euro zone bailout deal voted down by the Cypriot parliament.
Cyprus said the deal included the "most favourable terms under the present circumstances" for the island nation.
There was no immediate announcement about the fate of the Greek operations of Cyprus's third-biggest bank, Hellenic Bank , which are much smaller than those of the top two.
"It's unclear if the deal will include Hellenic Bank. Either way, it won't move the needle much," a Greek bank bailout fund official told Reuters.
Cypriot banks hold 8 percent of Greek banking deposits and 10 percent of loans. They have about 300 branches in Greece.
Euro zone finance ministers excluded the Greek branches of Cypriot banks from the deposit levy they intended to impose on Cyprus, on condition that those units would be transferred to Greek banks, which themselves are being recapitalised by bailout funds from the European Union and International Monetary Fund.
Hellenic Postbank, a small lender controlled by Greece's bank bailout fund, had also been cited as a potential buyer of the Cypriot units if interest by other lenders was deemed unsatisfactory, bankers had previously told Reuters.
Greece's own tottering banks are only slowly seeing deposits trickle back as fears of a Greek euro zone exit fade and Athens is determined to have Cypriot branches reopen after Monday's public holiday to avoid panic among savers, bankers said.
"The target for the Greek government and the domestic banking system is to fully operate the branches of the Cypriot banks in Greece on Tuesday without restrictions on deposits," a senior Greek banker said on condition of anonymity.
Investment manager PIMCO, which carried out a review of Cypriot bank capital needs that has yet to be published, had estimated Cypriot banks in Greece needed to be recapitalised with about 1.5 billion euros in funds, the banker said.
Half of that amount is expected to be covered by the Greek bank support fund HFSF and the other half from a Cypriot bailout deal, if one is eventually agreed with the EU and IMF, the banker said.
A sale will also help Cyprus to deleverage its vast banking sector, a key demand from the euro zone and the IMF.
The combined assets of Bank of Cyprus and Cyprus Popular Bank in Greece amount to about 22 billion euros, or 1.2 times Cyprus's near-18 billion euro economy.
If they are sold, the ratio of assets of Cyprus's banking system to gross domestic product will go down to 6.8 from about 8 times, bankers and analysts said - a step in the right direction in the eyes of international lenders.