The first mention in historical documents is of a small village organized around a chapel dedicated to San Miniato built by the Lombards in 783. By the end of the 10th century San Miniato boasted a sizeable population enclosed behind a moat and protected by a castle built by Otto I. In 1116, the new imperial vicar for Tuscany, Rabodo, established himself at San Miniato, supplanting Florence as the centre of government. The site came to be known as "al Tedesco", since the imperial vicars, mostly German, ruled Tuscany from there until the 13th century.