* San Marino banks, like Italian counterparts, hit by bad loans
* Tiny enclave has no fewer than six lenders
* Central bank aims to raise 100-150 mln euros this month -source
* Liquidity would go to banks pending longer-term solution
MILAN, June 5 (Reuters) - In the shadow of Italy's banking crisis, a much smaller financial emergency is unfolding in the tiny nation of San Marino, a wealthy enclave of 34,000 people perched on the picturesque slopes of the Apennines mountains.
The central bank of San Marino, a former tax haven landlocked inside central Italy, plans to inject liquidity into its ailing lenders, a first step toward overhauling them and finding new equity capital, said a source close to the matter.
The banks are burdened with 1.8 billion euros ($2 billion) in gross bad loans, a drop in the ocean compared with those of Italy's troubled banks but equal to 113 percent of San Marino's annual gross domestic product - enough to threaten its economy.
The republic, which opted out of joining the new Italian state in the 19th century, is less than 15 km (9 miles) from one end to the other. Nevertheless, it has no fewer than six banks, a legacy of its days as a discreet place where foreigners, especially Italians, parked their savings.
Like Italy, it is still slowly emerging from a deep recession caused by the global financial crisis a decade ago and has already bailed out some banks once in that time.
Secretary of state for finance Simone Celli told Reuters that this time the government would create a "bad bank" to house and manage bad loans attributable to San Marino residents. These accounted for almost half of total bad loans, he added.
Celli did not say how the banks' capital needs might be met.
However, the source told Reuters that the central bank aims to raise up to 150 million euros this month for the planned liquidity operation, ensuring the banks have stable funding while they and authorities work on finding a longer-term solution to the bad-debt problem.
The central bank could use some of its own securities to free up the funds required for the liquidity operation.
"The central bank is working to find a total of between 100 and 150 million euros to inject into the banking system to ensure necessary liquidity," said the source, who declined to be identified due to the sensitivity of the matter.
The source described the liquidity as a kind of first-aid measure, pending a restructuring of the banking sector.
It was not clear how many of the six banks would be involved in the liquidity operation.
AVOIDING A BAIL-IN?
San Marino needs to move fast. It uses the euro and, although not part of the European Union, it follows the rules of the common currency. By September 2018, it is expected to adopt the EU's controversial directive on state bailouts, which requires private investors in banks to suffer losses before any public funds are provided.
Known as a bail-in, this inflicts losses on shareholders, bondholders and possibly even some very large depositors. In San Marino, the biggest bank investors include the government itself and community-based banking foundations that re-invest their dividends in social, cultural and charitable activities.
A review this year of the six banks revealed they need about 260 million euros in capital, equal to a fifth of gross domestic product, in order to deal with their bad loans, the source said.
That estimate, based on San Marino's own prudential regulations, shoots up to 490 million euros when new global rules set by the Basel Committee of banking supervisors are applied, the source added. The larger estimate is roughly equal to San Marino's annual budget expenditure.
Last week, the central bank's credit and savings committee resolved to "adopt all available measures to guarantee the interests of savers, depositors and investors," according to a statement posted on the central bank's web site.
"The government is working to avoid a bail-in," Celli said.
Most depositors and investors are residents of San Marino or Italy. Its days as an international tax haven ended several years ago, following the 2008-2009 financial crisis.
San Marino central bank chief Wafik Grais, a former World Bank official, declined to comment to Reuters.
The San Marino state is already the major shareholder of local lender Cassa di Risparmio, which alone accounts for around half of the banking sector and has received various forms of public aid totalling 220 million euros since 2013.
On Friday, credit rating agency Fitch downgraded San Marino's rating by two notches to BBB minus, with a stable outlook. It said the banking situation called for a significant public recapitalisation. ($1 = 0.8875 euros) (Editing by Mark Bendeich and David Stamp)