San Marino, officially the Republic of San Marino (Repubblica di San Marino), also known as the Most Serene Republic of San Marino (Serenissima Repubblica di San Marino), is an enclaved microstate surrounded by Italy, situated on the Italian Peninsula on the northeastern side of the Apennine Mountains. Its size is just over 61 sqkm, with a population of 33,562. Its capital is the City of San Marino and its largest settlement is Dogana in the municipality of Serravalle. San Marino has the smallest population of all the members of the Council of Europe. With Italian being the official language, along with strong financial and ethno-cultural connections, San Marino maintains close ties to its much larger neighbour; it is located close to the riviera of Rimini, one of Italy's main coastal resort areas.
The country derives its name literally from Saint Marinus, a stonemason originating from the Roman colony on the island of Rab, in modern-day Croatia. In AD 257, Marinus, according to legend, participated in the reconstruction of Rimini's city walls after their destruction by Liburnian pirates. Marinus then went on to found an independent monastic community on Monte Titano in AD 301; thus, San Marino lays claim to be the oldest extant sovereign state as well as the oldest constitutional republic.
San Marino is governed by the Constitution of San Marino (Leges Statutae Republicae Sancti Marini), a series of six books written in Latin in the late 16th century, that dictate the country's political system, among other matters. The country is considered to have the earliest written governing documents, or constitution, still in effect.
The country's economy mainly relies on finance, industry, services and tourism. It is among one of the wealthiest countries in the world in terms of GDP (per capita), with a figure comparable to the most developed European regions. San Marino is considered to have a highly stable economy, with one of the lowest unemployment rates in Europe, no national debt and a budget surplus, and has the world's highest rate of car ownership, being the only country with more vehicles than people.
San Marino is one of the only three countries in the world to be completely surrounded by a single other country (the others being Vatican City, also surrounded by Italy, and Lesotho). It is the third smallest country in Europe, with only Vatican City and Monaco being smaller. It is also the fifth smallest country in the world.
Saint Marinus left the island of Rab in present-day Croatia with his lifelong friend Leo, and went to the city of Rimini as a stonemason. After the Diocletianic Persecution following his Christian sermons, he escaped to the nearby Monte Titano, where he built a small church and thus founded what is now the city and state of San Marino, which is sometimes still called the "Titanic Republic".
The official date of the founding of what is now known as the Republic is 3 September 301. In 1320 the community of Chiesanuova chose to join the country. In 1463 San Marino was extended with the communities of Faetano, Fiorentino, Montegiardino, and Serravalle, after which the country's border have remained unchanged. In 1631, its independence was recognized by the Papacy.
The advance of Napoleon's army in 1797 presented a brief threat to the independence of San Marino, but the country was saved from losing its liberty thanks to one of its Regents, Antonio Onofri, who managed to gain the respect and friendship of Napoleon. Thanks to his intervention, Napoleon, in a letter delivered to Gaspard Monge, scientist and commissary of the French Government for Science and Art, promised to guarantee and protect the independence of the Republic, even offering to extend its territory according to its needs. The offer was declined by the Regents, fearing future retaliation from other states' revanchism.
During the later phase of the Italian unification process in the 19th century, San Marino served as a refuge for many people persecuted because of their support for unification. In recognition of this support, Giuseppe Garibaldi accepted the wish of San Marino not to be incorporated into the new Italian state.
The government of San Marino made United States President Abraham Lincoln an honorary citizen. He wrote in reply, saying that the republic proved that "government founded on republican principles is capable of being so administered as to be secure and enduring."