The name is derived from Yazdegerd I, a Sassanid ruler of Persia. The city was definitely a Zoroastrian center during Sassanid times. After the Arab conquest of Iran, many Zoroastrians migrated to Yazd from neighboring provinces. By paying a levy, Yazd was allowed to remain Zoroastrian even after its conquest, and Islam only gradually became the dominant religion in the city.
Because of its remote desert location and the difficulty of access, Yazd remained largely immune to large battles and the destruction and ravages of war. For instance, it was a haven for those fleeing from destruction in other parts of Persian Empire during the Mongol invasion. In 1272 it was visited by Marco Polo, who remarked on the city's fine silk-weaving industry. In the book