Adud al-Dawla, now the ruler of Iraq, then took control of the territories under the control of the Bedouins and Kurds. He also killed almost all the sons of Hasanwayh, and appointed Badr ibn Hasanwayh, the last surviving son of Hasanwayh, as the ruler of the Hasanwayhid dynasty. It should be understood that during that period the word "Kurd" meant nomad. He then subdued the Shayban tribe, and fought against Hasan ibn 'Imran, the ruler of Batihah. He was, however, defeated, and made peace with Hasan who agreed to recognize his authority. During the same period, Adud al-Dawla had Izz al-Dawla's former "vizier" Ibn Baqiyya arrested, blinded, and then trampled to death by elephants. His corpse was thereafter impaled at the head of the bridge in Baghdad, where it would remain until Adud al-Dawla's death.