The name comes from a piece of farmland, a pagus Herannianus, which most probably lay where the pieve of San Leolino was later built, and it moved along with the place: first it belonged to the pieve, then it passed to the castle, then to the bridge over the Arno. The castle was already old in 1170, when the acts of a monastery call it the old castle of Rignano; the Ubertini held it, then Florence rebuilt it to control the territory and it ended up with the Mozzi, who had their own palatium inside it. When the Mozzi bank failed, in 1308, their Rignano properties and the castle passed to the Bardi; a branch of that family was involved in the Ognissanti conspiracy of 1340 against the Florentine government, and their possessions were sacked or destroyed, the castle included. For centuries, all the same, no real town formed here: the great majority of the inhabitants went on living in houses scattered through the fields, and the capoluogo stayed a few houses at the two ends of the bridge.
The comune as such was born on the thirteenth of February 1773, when Pietro Leopoldo abolished the leagues: fifteen popoli were detached from the podesteria of Pontassieve to form it. What made the town, though, was the railway from Florence to Rome, opened in 1866, which gave it a station and a yard for its farm produce; some twenty years later came a paper mill and a works for cement and hydraulic lime, using the limestone of the hills alongside. The population climbed to a little under seven thousand in 1917. The war took nearly all of it away: the bridge, the station and the town hall were destroyed, much of the central housing came down, the cement works was heavily bombed. And on the third of August 1944, near the hamlet of Troghi, an SS unit killed the wife and daughters of Robert Einstein, Albert's cousin: in all likelihood as a reprisal against him.