San Marino is the oldest existing Republic in the world. This is not just some boast, but historical fact. The beginnings of San Marino, as befits any good story, are shrouded in legend, putting the founding of the city into the hands of a saint, St Marinus. Like most of the early and many of the later Catholic saints, he is mythical but features a nice story.
Historical facts start in 885 with the judgement of Pesaro (at least I think it is Pesaro, it's called the Feretrian Judgment, and I would locate the Feretra family as the ruling house there at that time), wherein the independence of San Marino from any outside church authority is confirmed. Pope Boniface VIII acknowledged this independence again in 1296 but included the secular independence as well. Considering the insatiable drive of the Vatican for conquest, this guarantee was quite remarkable. The first complete book of laws still existing in San Marino dates from 1295. But complete independence can definitely be dated to 1296.
San Marino was occupied several times in its history, but never for longer than a few months at a time. It kept its independence and was also named the Peaceful Republic, as it never went to war with its neighbors or tried to annex bits and pieces of neighboring countryside. The Republic today has the same size it had from 1463 after being gifted with three castles and some grounds by the Pope. Its first constitution dates from 1600. Napoleon was a fan of San Marino, signed treaties with the Republic when he annexed Italy, and accepted its independence while never setting foot there. He even donated cannons for the defense of the country. To the unification of Italy at the end of the 19th century, San Marino said no thank you, and remained independent.
San Marino's inhabitants today live mainly from tourism. Every year, several million tourists invade the little country and its capital city. The Republic's finances are mainly funded by yearly payments from the Italian state not to interfere with the interests of Italy in fiscal and banking matters. The Republic has absolutely no debts, something other countries could emulate. Normally, San Marino is referred to as La Serenissima, the most serene. It has a small army for show purposes, but its security and defense are guaranteed by Italy.
For motor sport enthusiasts, San Marino has been on the map for several years with its Grand Prix in the Formula 1 circus. The race was taken out of the yearly calendar in 2007. There is still a Grand Prix of San Marino for motorcycles every year.
San Marino is a member of the United Nations. It uses the Euro as currency and even is allowed by special treaty to mint San Marino Euros but is not a member of the European Union. This is a holdover from the times when the Italian Lira, the Vatican Lira, and the San Marino Lira were accepted in all three countries as a matter of course.