Four kings succeeded each other during its nearly 80 years of existence, all of them belonging to an offshoot of the Zirid dynasty of North Africa, a Sanhaja Berber clan.
[2] The Zirids were a Sanhaja Berber clan from the central Maghreb (present-day Algeria), who served the Fatimid Caliphate and created a dynasty that thereafter ruled parts of North Africa on their behalf.
Zawi led the remaining rebels westwards and sought new opportunity in al-Andalus under the Umayyad Caliphs of Córdoba, the former enemies of the Fatimids and Zirids.
[6] However, his son and successor, 'Abd al-Malik al-Muẓaffar (r. 1002–1008), seeking able military commanders, granted Zawi and his followers permission to come to Córdoba, where they subsequently became an important part of al-Muzaffar's army.
[6] Historian Hugh Kennedy notes that while Abdallah's memoirs seek to legitimize Zirid rule, this narrative is plausible when considering the situation of al-Andalus at the time and the similar stories of other Andalusi cities inviting new rulers to protect them during the Taifas period.
[6] Soon after settling in the area, Zawi moved his capital from Madinat Ilbira (a site near modern Atarfe) to the more defensible Granada (Gharnāṭa) nearby.
[10][11][6] Granada had been hitherto a small settlement on the right bank of the Darro river,[12][n. 1] and Zawi's move to this location resulted in the foundation of a new city[7] and an independent polity that lasted 77 years.
In 1018, the Umayyad pretender Abd al-Rahman IV, known as al-Murtaḍā, laid siege to Granada but his forces were decisively defeated by the Zirids.
[6] Habbus organised the military by dividing his kingdom into smaller provinces, each of which was charged with recruiting a jund militia which contributed to the Zirid army.
[16] Granada's greatest rival was the Taifa of Seville, but at this early stage, the balance of power was in favour of the Zirids, who conducted several military campaigns to the west.
[17] Zuhayr al-'Amiri, the ruler of Almeria, attempted to exploit these internal dissensions in 1038 by refusing to renew the alliance he had concluded with Habbus and by invading Granada's territory.
[20] Under the kings Habbus and Badis, the Jewish administrator known as Isma'il ibn Nagrilla (in Arabic) or Samuel ha-Nagid (in Hebrew) progressively became the most powerful political figure in the state.
[21] After Isma'il's death in 1056, his son Yusuf (Joseph) took over his position but lacked his father's political skill and prudence, quickly making enemies among other factions within the state while the king, Badis, remained ineffective.
[21] In 1066, Yusuf secretly invited al-Mu'tasim, the ruler of the neighbouring Taifa kingdom of Almería, to take control of the city and install him as client king in place of the Zirids.
When Badis died in 1073, his grandson, 'Abdallah ibn Buluggin, was chosen by an assembly of Sanhaja dynastic officials and shaykhs to be his successor, despite 'Abdallah being between 7 and 9 years of age.
[21] One of Alfonso's main strategies, as described in Abdallah ibn Buluggin's memoirs, was to goad both Seville and Granada into attacking and weakening each other, all while forcing both sides to pay parias (a tax or tribute) to him.
The ruler of Almeria, al-Mu'tasim, exploited Granada's weakness again by reclaiming Baeza with the aid of its Zirid governor, Ibn Malhan.
The Almoravids detained him and confiscated all his properties, but he was allowed to retire in exile in Aghmat (in present-day Morocco), where he wrote a political memoir about his reign and his dynasty, called the Tibyān, which has provided modern historians with a great deal of information about this period.
[29] People of various other backgrounds were also present, including muwalladūn (Muslims of Iberian descent), those descended from other tribes in North Africa, and slaves of both black and white ethnicities.
[31] The Arabs had largely settled in the region of Granada during Umayyad rule, mostly originating from the jund (soldiers) of Damascus in the early days of al-Andalus.
[34][37] As scholar David William Foster puts it, "the peak of Sephardic Judaism as a political as well as cultural reality is found in eleventh-century Granada.
[39] Foster characterizes the Zirid state during this period as a "Jewish kingdom in all but name" with the Muslim ruler as a figurehead with no real power.
[34] Samuel also cultivated relations with Jewish communities throughout the Muslim world in North Africa and the Middle East, sending gifts and sponsoring scholars.
It is traditionally dated to the time of the Zirids in the 11th century, during the reign of Badis ibn Habus or Abdallah, based on an early study by Leopoldo Torres Balbás.