The Annazids or Banu Annaz (990/991–1117) was a Kurdish Sunni Muslim dynasty which ruled an oscillating territory on the present-day frontier between Iran and Iraq for about 130 years. The Annazids were related by marriage to the Hasanwayhids who they were in fierce rivalry with. The legitimacy of the Annazid rulers stemmed from the Buyid amir Bahāʾ al-Dawla and the dynasty relied on the Shadhanjan Kurds. Ali ibn al-Athir stated that the name ʿAnnāz derived from the word ʿanz meaning 'she goat' and signifies the owner, merchant, or shepherd of goats. However, Sharafkhan Bidlisi and Hamdallah Mustawfi put forward the name Banū ʿAyyār arguing that the Arabic word ayyār meaning 'smart' or 'shrewd' was also common in Kurdish and Persian and was used as a nickname for Kurdish families, while nor ʿanz or ʿannāz are mentioned in Kurdish dictionaries. The Annazids principally controlled Kermanshah, Hulwan, Dinavar, Shahrizor, Daquq, Daskara, Mandali and Numaniyah. The founder of the Annazids dynasty was Abu’l-Fatḥ Moḥammad b. ʿAnnāz (d. 1010-11) who ruled Hulwan and likely attached to the administration of Baha al-Dawla of the Buyid dynasty. In the first twenty years of his rule, he fought the Banu Uqayl and temporarily captured Daquq and also fought Banu Mazyad around Khanaqin. In 1006, Badr ibn Hasanwayh and Abu’l-Ḥasan ʿAlī b. Mazyad of the Hasanwayhids sent 10,000 soldiers against the Annazids which forced Abu’l-Fatḥ to seek refuge among the Buyids in Baghdad. In a treaty between the two dynasties that same year, Abu’l-Fatḥ declared himself a vassal of the Hasanwayhids. Abu’l-Fatḥ was succeeded by his son Ḥosām-al-dawla Abu’l-Šawk (ruled until about 1046) whose tenure was filled with destruction and internal conflict. For this reason, his territory fluctuated greatly; at its highest it reached Hillah, while it at its lowest was limited to western Iran. He married into the Banu Mazyad dynasty which improved relations between the two dynasties. After the death of Badr ibn Hasanwayh, Lur tribes and Shadhanjan came under the control of Abu’l-Šawk.