Qazvin (; , , also Romanized as Qazvīn, Qazwin, Kazvin, Kasvin, Caspin, Casbin, Casbeen, or Ghazvin) is the largest city and capital of the Province of Qazvin in Iran. Qazvin was a capital of the Safavid dynasty for over forty years (1555–1598) and nowadays is known as the calligraphy capital of Iran. It is famous for its traditional confectioneries (like Baghlava), carpet patterns, poets, political newspaper and Pahlavi influence on its accent. At the 2011 census, its population was 381,598. Located in northwest of Tehran, in the Qazvin Province, it is at an altitude of about above sea level. The climate is cold but dry, due to its position south of the rugged Alborz range called KTS Atabakiya. History Qazvin has sometimes been of central importance at major moments of Iranian history. It was captured by invading Arabs (644 AD) and destroyed by Hulagu Khan (13th century). In 1555, after the Ottoman capture of Tabriz, Shah Tahmasp (1524–1576) made Qazvin the capital of the Safavid empire, a status that Qazvin retained for half a century until Shah Abbas I moved the capital to Isfahan in 1598. It is a provincial capital today that has been an important cultural center throughout its history. Qazvin is located at a crossroads connecting Tehran, Tabriz, and the Caspian Sea region, which has historically been a major factor in its commercial importance. However, it never rivalled other major Iranian cities like Ray, Nishapur, or Isfahan during the Middle Ages. One reason is that its growth is constrained by a lack of water. Until fairly recently, the entire Qazvin plain was irrigated by just a single qanat and four small streams. Prehistory The earliest remains of prehistoric humans have been discovered in a cave called Qaleh Kurd where archaeologists discovered a Neanderthal tooth. Archaeological findings in the Qazvin plain reveal urban agricultural settlements for at least nine millennia. Sasanian era Qazvin was founded by Shapur I (), the second ruler of the Sasanian Empire. It was refounded by Shapur II (), who established a coin mint there. Under the Sasanians, Qazvin functioned as a frontier town against the neighbouring Daylamites, who made incursions into the place. Early Islamic dynasties Qazvin came under the expanding Rashidun Caliphate in 644, during the reign of Umar. It was taken by Al-Bara' ibn 'Azib, who besieged the city and received a request for a sulh (agreement) from its inhabitants. They