The city became the capital of the Hammadid Berbers .
The city sustained a siege from the Zirid in 1017 .
The city became the capital of the Hammadid Berbers , and sustained a siege from the Zirid in 1017 .