A country in the Apennines near the Adriatic Sea. It is surrounded by Italy and is the world's smallest republic. Founded, according to tradition, in the fourth century ad , San Marino was recognized by the papacy in 1631 and has maintained its independence, with a few brief interruptions, ever since. It signed a treaty of friendship with Italy in 1862, was allied with Italy in World Wars I and II, and was bombed by the Allied forces in 1944. The town of San Marino is its capital.