 The Hammadids became independent in 1014, with their capital at Qal'at Beni-Hammad.With the withdrawal of the Fatimids to Egypt, however, the rivalry with the Umayyads decreased.Al-Hakam II sent Muhammad Ibn Abi Amir to north Africa in 973–974 to act as "qadi al qudat" to the Berber groups that had accepted Umayyad authority.