San Leo stands on a limestone block that rises sheer out of the Marecchia valley, and from a distance it looks like a fortress that nobody could possibly have captured. The ground under it tells a longer and stranger story. The evaporite rocks in this area, gypsum and associated salts, were laid down around six million years ago, when the Mediterranean nearly dried out in what geologists call the Messinian salinity crisis. Seawater evaporated, minerals crystallised, and the beds you see in the cuttings are the leftovers of that event.
Above them the fortress dominates the skyline, remodelled by Francesco di Giorgio Martini for the Montefeltro dukes in the fifteenth century, and it was later used as a prison. The most famous inmate was the adventurer Count Cagliostro, who died here in 1795 after being condemned by the Inquisition. Dante mentions San Leo in the Purgatorio, as an example of a place hard to climb, and Saint Francis is said to have been given Monte Alverna by a count at a gathering in the area. The village itself is small, quiet and made of the same pale stone as the rock, with a Romanesque parish church and cathedral that are older than the fortress.
On the bike, the main road along the Marecchia from Rimini is smooth and fast, and then you reach the climb to San Leo, a short, twisting road cut into the cliff with hairpins and a view that gets better with every turn. Further inland the Montefeltro hills give lovely, quiet riding on roads that wander through villages and past castles, though the surface can be broken after winter and the corners tighten without warning. Spring and autumn are best; in August the heat gathers in the valley and the car parks fill.
San Marino is only a short distance away, which means a lot of cheap fuel on that side of the border and a lot of souvenir shops. In San Leo itself there is little more than cafes and small restaurants, so buy fuel in the valley, in Novafeltria, Pennabilli or Borgo Maggiore, before you climb. A strong coffee and a sit on the small piazza under the fortress is a good way to pass the middle of the day.