Historians consider the history of the city of Qom to be related to before Islam, but its fame is more to the period after Islam. In legendary narratives, its construction is attributed to Temmorth. In the year 23 AH, Abu Musa Abd... Ibn Qays Ash'ari conquered the city. During the caliphate of Ma'mun, people refused to pay tribute to Yahya Ibn Imran. Then the Caliph, the ruler, destroyed the city walls and took many properties from the people. Once again, during the time of Mu'taz, the people revolted, and the caliph at the time, the ruler of Iraq, sent Ajam to suppress them, and he destroyed the wall of the city, which had been rebuilt. According to the narrations, in the year 200 AH, Hazrat Masoumeh (pbuh) left for Khorasan, eager to meet her brother Imam Reza (pbuh), but fell ill near the city of Saveh and went to Qom. In this city, the holy spirit of that great lady joined the Kingdom of God and was buried in Astana.
For this reason, they gradually moved their houses closer to the shrine. Qom was subject to Isfahan until the end of the 2nd century AH and did not have an independent ruler. It was separated from Isfahan during the time of Harun al-Rashid. During the Abbasid caliphate, when Ali's family was oppressed, many Sadats took refuge in Qom, and from this date, Shia ideas penetrated the minds of the people, and this city became the center of Shia. During its lifetime, Qom was severely damaged by the Mongol and Timur seditions and became a settlement during the Safavid period. It was destroyed again in the attack of Afaghaneh, but it was restored and its prosperity has been increasing day by day since the Qajar era. Currently, this city is one of the most famous cities in Iran due to the location of Hazrat Masoumeh's shrine, the Jamkaran Mosque, the valuable theological seminary and scholars, and the warm-hearted, cultured, and of course the followers of the province.
Denomination
Many historical traditions have been narrated regarding the name of Qom. One of the most scientific traditions is the conversion of the word "kome" (which means small houses together) to komm and then to Qom by the immigrant Arabs. Some consider Qom to be derived from Komidan - the name of a part of this region - which was called Qom for short, and then the Arab immigrants changed it to Qom.
Before Islam, archaeological information in the Qom region indicates the traces of human activity in the Paleolithic age, which is nearly fifteen thousand years old, and based on the analysis of the achievements of six seasons of scientific exploration in the Qomrud hill, the history of the formation of early villages in the Qom region It goes back to the fifth millennium BC. Also, the objects and artifacts found from other explorations and surveys in the province indicate the flourishing of human civilization in the Neolithic and Iron Age in Qom. The mythical history of Iran also tells about the creation and establishment of urban structures during the time of Tahmorth Deoband, king of Pishdadi, and another tradition attributes the establishment of urban structures in Qom to the legendary king of Iran, Ki Khosro. What is certain is the Qom region based on archaeological evidence such as prehistoric hills, fire temples and castles of the historical era and the book of Qom (the most important work of local geography, written by Hassan bin Muhammad bin Hassan Qomi in 379 AH). In the pre-Islam era, especially the Sassanid period, it was one of the relatively large and prosperous cities of Iran.
Early Islamic centuries
Before the arrival of the Arabs and after, the major change in the state of the city was the transformation of its central nucleus into a city during the second and third centuries of Hijri. Since then, the name of this center, Qom, has appeared in many geographical books of the 4th century AH and after. The fame of this city in the geographical sources compiled in the 4th century Hijri was due to its Shia religious orientation, unlike the religious orientation of other nearby cities. The Arabs living in this city were from the Yemeni Ash'ari tribe living in Iraq, who moved to this land from Iraq in the seventies to the eighties of the first Hijri century due to religious and political differences with the Umayyad government. The Ash'ari Shiites took over the religion of the city and remained based on the Shi'ite religion. Later, after the burial of Hazrat Fatima Masoumeh (PBUH) in 201 AH in this city, its religious centrality remained more stable than before.
In terms of geographical division, the city of Qom became part of the Jebel province of Iran from the fourth century onwards. The borders of this state were Hamedan in the west, Isfahan in the south, and Shahr Ray and Qazvin in the north. The city's water was supplied through canals and the Qom River, which originates from the heights of Khansar and Golpayegan. According to the history of Qom, the city's water was sweet. But in the last few centuries, due to the mixing of underground water with salt mines, its water became salty, and today this is the most important problem of the city. After the construction of Panzdeh Khordad dam (opened in 1373) to supply water to Qom, the Shahr river dried up and it is used as a crossing point for possible floods and at other times as a stopover.
Islamic Middle Ages
During the period of Al-Buyeh (4th century Hijri), Qom received little attention due to its tendency towards the Shiite religion, and during the Seljuq period (5th and 6th century Hijri), writers and teachers from the people of Qom were employed in this government. The Grand Mosque of this city is a relic of the Seljuk period. Throughout this period, the city of Qom as a Shia city was in contact with the cities of Ray, Kashan, Ave and Farahan and spread the Shia religion in those areas. This city was killed and looted during the Mongol attack. In the 8th and 9th centuries of Hijri, Qom was a small city, but due to the presence of the blessed threshold of Hazrat Masoumeh (PBUH) in this city, it was more or less the attention of rulers and amirs. In the 8th century, a prominent family, including the Safi family, lived in this city and were local amirs. They maintained their power in this city by establishing relations with big governments. Of course, sometimes due to these competitions, the city of Qom was attacked and invaded.
During the time of Qaraquyonlu and Aq Quyunlu in the 9th century of Hijri, the city of Qom was noticed by the leaders of this dynasty. For example, Uzon Hasan stayed in this city in winter and sometimes in spring, and it was known that this city was the winter residence of the kings of this dynasty. Also, there are orders from the kings of this dynasty about the guardianship of Hazrat Masoumeh's threshold.
late period
During the time of Shah Ismail Safavi, this city gained more prestige. The architectural monument of Shah Ismail in Qom is the northern porch of the Astana of Hazrat Masoumeh (925 A.H.) whose inscription is available. After that, the city of Qom received more attention and because of the sanctity of the shrine of Hazrat Masoumeh (S), it was used as a center for the burial of some Safavid sultans. The graves of five Safavid sultans with the names of Shah Safi (1052 AD), Shah Abbas II (1077 AD), Shah Suleiman (1105 AD) and Shah Sultan Hussein (deposed in 1135 AH), Shah Tahmasb II (deposed in 1144 AH) and a number of other princes and rulers of this government are around the shrine. The issue of transferring the dead to Qom for burial, although it had a history before this time, but it became official in the Safavid period and continued until recent years. The coming and going of Shah Abbas to Qom to visit and meet with Faiz Kashani (1091 AD) also shows the importance of this city. The emergence of scholars such as Mullah Sadrai Shirazi (1050 to 979), Qazi Saeed Qomi and the residence of Mullah Muhammad Taher Qomi (1098 AD) and Fayaz Lahiji (1072 AD) in it indicate the scientific importance of this city in this period. Undoubtedly, the city of Qom owes its physical and cultural growth in the recent period to the attention of the Qajar sultans, especially Fath Ali Shah (reigned from 1212 to 1250), his children and some of his ministers and later sultans. At the beginning of his reign, Fath Ali Shah vowed to spend one hundred thousand gold tomans in the renovation of the shrine of Hazrat Masoumeh (S). During this period, Mirzai Qomi (1232 AD) lived in this city. He was highly regarded by Shah Qajar and he entered this city many times with the intention of visiting this city and meeting Mirza Qomi and stayed there for a while.
According to the existing inscriptions, the current building of Astana is mainly from the Qajar period, as the existing inscriptions fully prove this. In terms of construction, Qom experienced a new experience during the Nasrid period. In addition to creating a new series of aqueducts, a new building was built with the efforts of some local elders and government officials. The tombs of many royal members of the Qajar dynasty are in the ancient court of Astana. The most famous of them is the tomb of Fath Ali Shah Qajar, which has a very beautiful marble stone placed on it and a beautiful independent cell is dedicated to it.
The tomb of Mohammad Shah Qajar is also located in the old courtyard. We can also mention the tombs of Mahd Alia, the mother of Naser al-Din Shah, Fakhr al-Doleh, the daughter of Naser al-Din Shah, Motamed al-Doleh Garji, one of the prominent political figures of the Qajar period, and many others. The tomb of Mirza Hasan Khan Mostofi al-Mamalek is also one of the beautiful Qajar tombs in the area of the ancient courtyard of Hazrat Masoumeh (PBUH). During the Qajar era, Qom underwent a new demographic transformation and the ethnic composition of the city changed. This means that many clans went to Qom and its surroundings in the form of mass migrations from the west, and by gradually entering the city, they changed its population composition. In such a way that the main residents of the city disappeared, except in the very old neighborhoods of the city, between the Haram and the Grand Mosque.
The important clans that settled in Qom are: Begdali, Zandiyeh, Saaduna, Gaini, Kalhar, Leshni, Karze Bar, Abdul Mulki, Khalj and Shadqoli. Due to the special scientific effort that was made in recording the information related to the city of Qom during the Nasrid period, and due to the authoring of works such as the history of Qom's Dar al-Alayman, among others, it is possible to gain a detailed understanding of the state of this city during the Nasrid period.