The township of Qazvin is bounded by Mazandaran and Gilan provinces on the north, the township of Takestan to the west, and to Bo'inn Zahra in the south, whereas the province of Tehran is to its east. The northern region of township is occupied by the Alborz Mountains but its southern parts are in even and fertile plains. The center of the township is the city of Qazvin located 144 km. to the west of Tehran. There is a strong possibility that the city of Qazvin was primarily founded by Shapour Sassanide I, (known as Shad Shapour). He founded the city in order to confront the attacks of the Dialameh. After which it gradually developed into the city of Qazvin. During the Arab conquests, one of the Arab famous commanders known as Bara Ebne Azeb surrounded the city in the year 24 AH. In the early Islamic era Qazvin served as a basement for the Arab military operations. The Jame' mosque of the city was built during Omavi Dynasty. This has always been one of the most important mosques of the city right till the reign of Haroon-Ol Rashid.
In 176 AH. another city or castle was built opposite the old city of Qazvin. This was known as Madineh Mobarakeh. Here a mosque and a rampart, was founded by Haroon-Ol Rashid. From the late 5th century AH. till the attack of Holakoo to Esmaili castles, Qazvin was subject to many events resulting from the Hassan Sabbah movement and that of his successors. However in the Safavid reign Qazvin became capital and many buildings were built there. When the Qajars took the power in their hands, and made Tehran their capital, the importance of the city increased. Qazvin was located en route from Tehran to Europe and Russia. Today Qazvin has become one of the industrial cities in the country.