Main article: History of San Marino
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.
The official founding date 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 borders have remained unchanged.
In 1503, Cesare Borgia, the son of Pope Alexander VI occupied the Republic for six months until his father's successor, Pope Julius II, intervened and restored the country's independence.
On June 4, 1543 Fabiano di Monte San Savino, nephew of the later Pope Julius III, attempted to conquer the republic, but his infantry and cavalry failed as they got lost in a dense fog, which the Sammarinese attributed to Saint Quirinus, whose feast day it was.
After the Duchy of Urbino was annexed by the Papal States in 1625, San Marino became an enclave within the Papal States, something which led to its seeking the formal protection of the Papal States in 1631, but this never equalled a de facto Papal control of the republic.
The country was occupied on October 17, 1739 by the legate (Papal governor) of Ravenna, Cardinal Giulio Alberoni, but independence was restored by Pope Clement XII on February 5, 1740, the feast day of Saint Agatha, after which she became a patron saint of the republic.
Official languages Italian