A very brief overview of San Marino in WWII:
There’s a bit more meat to San Marino’s experience during WWII. Despite a fascist government that was unsurprisingly aligned with Mussolini’s Italy, San Marino had declared neutrality and tried to ensure Allied countries acknowledged it. It seems that the British and the Americans were willing to accept that San Marino had not declared war, but were reluctant to acknowledge its neutrality – likely because how aligned it was with Italy. (Italy also spread false reports of San Marino declaring war on the Allies, which had to be debunked by officials.)
San Marino holds claim to having hosted 100,000 refugees during the war, which boggles the mind since San Marino seems to have only had a population of 15,000 or so at the time. I can’t seem to find a lot in English – there is a book in Italian about Jewish refugees in San Marino during the war that sadly hasn’t been translated – but it seems most of that number is likely temporary refugees of Italians fleeing the fighting as the Campaign moved up the peninsula.
As the fighting came close to San Marino, it’s neutrality was soundly ignored by both sides. The British had bombed San Marino’s railway in 1943 on faulty intel alleging that Germans were storing weapons in the tunnel (more on that here). In 1944, Germans took up defensive positions in San Marino, despite that violating the country’s neutrality, and then the British defeated the Germans in the Battle of San Marino and in turn occupied Mount Titano until the end of the war.
San Marino tried to get compensation from Britain for wartime damage, which the British rebuffed, arguing that the Germans had breached neutrality first, but in the 60s, San Marino was able to get some compensation for the destroyed railway from the UK.