Qazvīn, also spelled Kazvin, is located in north-central Iran in a wide, fertile plain at the southern foot of the Elburz Mountains. Originally called Shad Shāhpūr, it was founded by the Sāsānian king Shāpūr I about ad 250. It flourished in early Muslim times (7th century), serving as a base for Islamization. Genghis Khan laid waste the city but it revived under the Ṣafavids when Shāh Ṭahmāsp I (ruled 1524–1576) moved the capital from Tabriz to Kazvin.
Āghā Moḥammed Khān of the Qājār dynasty established Qazvīn about 1796 as a major base for foreign trade with the Caspian Sea, Persian Gulf, and Asia Minor. Luxury goods, Chinese raw silk and Indian goods such as jewels, aromas, opium, and spices delivered were the products mostly delivered to Qazvīn. The city is a regional communications centre, connected by road and rail with Tehrān and Tabriz and by road with the Caspian Sea and Hamadan.