The lengthy ridge of Mount Titano crowns three fortresses, with the town of San Marino clustered at the foot of its walls. Rocca Guaita, built in the 11th century, is the first and early part of the fortress. For a bit, it acted as a gaol and was renovated several times for different reasons until it achieved the form we see today.