Since the 12th century, this small state has been able to maintain its independence throughout. Even after the founding of the Italian nation state in 1861, its status was reaffirmed and the Republic of San Marino is now the last of the once important self-governing city states of the Italian Renaissance.

The city-state has no industrial history. For centuries, the most important commercial activity was the quarrying of sandstone on Monte Titano, on which the city is located. This is why Saint Marinus, the city's eponymous patron saint from late antiquity, is considered a stonemason. The quarries were still in use at the turn of the 20th century, but the deposits have since been exhausted.

In 1932, San Marino opened a narrow-gauge electric railway that connected the town to the Italian railway network via a winding and tunnelled route. As a result of war damage, however, operations were discontinued as early as 1944. Today, the manufacturing industry is concentrated in the Serravale district, where, in addition to traditional ceramics, clothing and electronic components are produced for export. However, the economy is dominated by banking and tourism.