The presence of human settlements in the area dates to Roman and Etruscan times, although the villages of the modern municipality are known from the 11th century, when San Pietro in Mercato and Lucardo are mentioned. In 1393 the borough of Montespertoli was acquired by the Machiavelli family.