Since then around €4bn of the roughly €14bn held in San Marino banks have been taken out of the country.

The repercussions were serious because the banking sector accounts for about a quarter of GDP, and the effects have been amplified by a downturn in the local economy.

The reputation of the republic, which consists of a 2,000ft-high limestone mountain surmounted by castles and stone battlements, has also been tarnished by banking scandals and a lack of transparency.

“The downgrades reflect the material deterioration in San Marino's financial sector, which could give rise to potentially significant contingent liabilities for the sovereign," the ratings agency said.

This was "coupled with a weaker than expected outlook for the economy" and poor fiscal performance which "has eroded the government's strong liquidity position and revealed limited fiscal financing flexibility."

San Marino is not a member of the eurozone so strains on bank liquidity and solvency "are all the more acute as Sammarinese banks lack a credible lender of last resort”, Fitch said.

Officially known as the Most Serene Republic of San Marino, the 24-square mile, landlocked republic is the third smallest state in Europe after Monaco and the Vatican.

It is entirely surrounded by Italian territory and has a population of around 30,000.

It claims to be the world’s oldest republic – legend has it that it was founded in AD301 by a stonemason for a small community of Christians seeking refuge from the Roman emperor Diocletian. It has been occupied only twice in its 1,700 year history.