Qum is a city in north-central Iran, situated east of the Zagros range. Although archaeological discoveries from this region indicate that settlements existed here in antiquity, very little is known about Qum itself before the Islamic period. Archaeological remains with Sasanian levels (Qal'a-yi Dukhtar) do suggest that the immediate area was populated during the Sasanian period, in addition to mentions of a Sasanian town in some Islamic sources. It is probable that the Sasanian site was a series of small towns clustered around one another rather than a complete town.
During the early Abbasid period, the region was settled by Arab families who came from Yemen via Kufa. As the Arab population grew and the Persian nobility dwindled, the geographical and cultural character of the area changed. The Sasanian towns grew together and by the ninth/third century AH, Qum was considered a small city. The Arabs were Shi'a in faith, and this fact separated Qum from the most important city in the region, Isfahan, whose inhabitants were Sunni. The town's fame as a center of Shi'ism increased after Fatima Ma'sumah, the wife of the eighth Shi'a imam, died and was buried there in 816-817/201 AH. Over the following centuries, her tomb would develop into a major Shi'a shrine.
The city gained prosperity during the reign of the Seljuks of Iran, a Sunni dynasty, and then suffered during the invasion of the Mongols in the thirteenth/seventh century AH. It was not completely destroyed, however, as its shrines are still mentioned during the following politically tumultuous period in Iran.
Qum acquired an unprecedented importance during the reign of the Shi'i Safavid dynasty of Iran
, when Shah Abbas I adopted a policy to develop the two major Shi'a centers of pilgrimage in Iran: the tomb of Fatima Ma'sumah at Qum and of her husband, the eighth Shi'a imam 'Ali al-Riza, at Mashhad. Concurrent with the expansion of its shrine, Qum became a popular burial place for Safavid princes, as well as Shi'i religious scholars, attracting an aura of holiness to the central Iranian city that persists today.