Perhaps due to the legacy of the Ridda Wars and Najdah's Kharijites, the Umayyads and Abbasids made sure never to appoint a member of the tribe to governorship in their native province of Yamamah. In the 9th century, the Alid dynasty of Banul Ukhaidhir came to power in al-Yamama, having fled there from their native Mecca. According to Yaqut and others, Ukhaidhirite rule was harsh on Bani Hanifa, leading many of them to leave for Basra in Iraq, and to Upper Egypt, where sources such as al-Yaqubi of the 9th century state that Bani Hanifa formed the majority of the population of the valley of Wadi al-Allaqi, near Aswan, having moved there earlier with their women and children. There they worked in gold mining, and according to Yaqut, the "sultan of al-Allaqi" was a man of Bani Hanifa.