People were living around Kashan long before it was a town. Stone tools from the Old Stone Age have been found at the Niasar spring, at Kaftar Khoun and at Sefid-Ab, southwest of the city. Kashan ranks among the longest continuously lived-in cities on earth, and some date it to the Elamite period.
No one knows when the town itself was founded, and stories have filled the gap. Some accounts make it the home of the magi who followed the star to Bethlehem, a tale the friar Odoric of Pordenone repeated in 1330 after a visit. A Safavid-era legend says Abu Lu'lu'a, the Persian craftsman who killed the caliph Umar in 644, fled here. The shrine over his supposed tomb is a landmark, with a cone-shaped dome tiled in turquoise.
In the Timurid period Ulugh Beg, a grandson of Timur, patronised the city. Rule then passed to the Qara Qoyunlu and the Aq Qoyunlu. The Safavid shahs used Kashan as a leisure retreat, and the garden at Fin dates from 1590.
In 1778 an earthquake flattened Kashan, including the buildings of Abbas the Great, and killed 8000 people. The city was rebuilt. The Ameri house notes that the houses around it were rebuilt after the 18th-century quakes, and the Abbasian house and Agha Bozorg Mosque date from the late 18th century.
Heritage recognition is recent. In 2007 Iran listed a combined Fin, Sialk and Kashan heritage axis as a possible World Heritage site, and in 2012 Fin Garden was inscribed on its own with the Persian Gardens. Flights resumed on 2 June 2016, after a gap of twenty years. In 2021 an observatory opened on Mount Gargash, chosen in 2003 after 40 summits were assessed for light pollution.