Dinavar (also spelled Dinawar and Daynavar; ) was a major town between the 7th and 10th centuries, located to the northeast of Kermanshah in western Iran. The ruins of the town is now located in Dinavar District, in Sahneh County, Kermanshah Province. History Located in the centre of the ancient region of Media, Dinavar is first attested in history as a town founded by the Greek Seleucid Empire (312 BC–63 BC), but it may have been older. Like the neighbouring town of Kangavar, Dinavar also hosted a Greek population. Under the Sasanian Empire (AD 224–651), Dinavar served as an important fortified place, and was reportedly attacked by the Khazars in the early 6th-century. In 642, following the defeat of the Sasanians against the Arabs at the Battle of Nahavand, Dinavar was conquered. During the reign of the Umayyad caliph Mu'awiya I (), the town was renamed Mah al-Kufa and made one of the two districts of Jibal (Media). Dinavar consisted of the northern areas, whilst Karmisin (Kermanshah) consisted of the southern areas. Dinavar bordered Hulwan in the west; Masabadhan in the south; Hamadan in the east; and Adharbayjan in the north. The "Mah" in the Mah al-Kufa probably refers to Media. Dinavar had some importance due to its geographical location, serving as the entrance to Jibal as well as a crossroad between the culture of Iran and that of the inhabitants on the other side of the Zagros Mountains. The town flourished under the Umayyad and Abbasid caliphates. According to the Arab writer Ibn Hawqal (died after 978), Dinavar was only one-third less smaller than Hamadan in the 10th-century. Dinavar historically has produced many scholars including Ibn Qutaybah, Fakhr-un-Nisa, and Abu Hanifa Dinawari. Dinavar was also the center of the Kurdish principality of the Hasanwayhids. It was sacked by Mardavij in 931. According to Ibn Athir it was plundered by Turkmen of the Iva tribe in 1172/73. According to the 14th-century geographer Hamdallah Mustawfi (died after 1339/40) in his Nuzhat al-Qulub, Dinavar was a small town during his lifetime. However, it was later destroyed by Timur by the end of the 14th-century. Today only field of ruins are available. Notable figures Ibn Qutaybah (died 889), 9th-century scholar, best known for his contributions to Arabic literature Abu Hanifa Dinawari (died 896), 9th-century scholar who wrote the Kitāb al-akhbār al-ṭiwāl, possibly the most apparent early effort to combine Iranian and Islamic history