Taifa of Granada

The Taifa of Granada (طائفة غرناطة, Ta'ifat Gharnata) or Zirid Kingdom of Granada was a Muslim kingdom that was formed in al-Andalus (in present-day Spain) in 1013 following the deposition of Caliph Hisham II in 1009. The kingdom was centered on Granada, its capital, and it also extended its control to Málaga for a period. 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. The Taifa of Granada was considered to be the wealthiest out of all of the taifa kingdoms. It was eventually conquered by the Almoravids in 1090, putting an end to Zirid rule in Granada.

Origins and establishment
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. The dynasty was founded by Ziri ibn Manad, who was succeeded by his son Buluggin after 971, ruling from Kairouan in Ifriqiya (present-day Tunisia). In 999, many of Buluggin's brothers, including Zawi ibn Ziri, rebelled against his grandson, Badis ibn al-Mansur, due to their exclusion from power by Buluggin and his descendants. The rebels, based in 'Ashir, were defeated in battle and most of the brothers were killed except for Zawi. 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. The hajib of Caliph Hisham II (r. 976–1009) and de facto ruler of the Caliphate of Córdoba at the time, Ibn Abi ʿAmir al-Mansur (also known as Almanzor), initially refused to allow Zawi's immigration to al-Andalus, believing his reputation as a troublemaker. 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. The new Zirid arrivals were probably also accompanied by their families from North Africa.

The Caliphate of Córdoba fragmented after 1008 during a period known as the fitna of al-Andalus. Zawi initially played a role, along with other Berber factions, in the siege of Córdoba between 1010 and 1013. By the end of the siege they succeeded in installing their own puppet caliph in Córdoba, Sulayman al-Musta'in, but by this point Zawi and other factions probably understood that the dominance of Córdoba was at an end and they sought political fortunes elsewhere in al-Andalus. The new caliph granted Zawi and his faction the kūra (province) of Ilbira (or Elvira) to settle in 1013. According to the narrative provided by the later memoirs of Abdallah ibn Buluggin (the last Zirid king of Granada), the Zirids settled there at the request of the local population who sought protection from outside attackers but were unable to organize themselves. 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. 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. Granada had been hitherto a small settlement on the right bank of the Darro river, and Zawi's move to this location resulted in the foundation of a new city 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. Soon after, in 1019 or 1020, Zawi left al-Andalus for North Africa, resuming his ambitions within the Zirid state there, which was under the rule of the young al-Muizz ibn Badis but embroiled in an internal struggle with Hammad ibn Buluggin, a family member who had declared his independence from the Zirids of Kairouan in 1015 and founded the Hammadid dynasty. Zawi's fate is not known for certain: according to Ibn Hayyan he died of the plague years later, while Abdallah ibn Buluggin's memoirs claim he was poisoned not long after arriving in North Africa, but neither source gives the date of his death.

Expansion and apogee
In Granada, Zawi's nephew Habbus ibn Maksan was invited by the qadi of the city, Abu 'Abdallah ibn Abi Zamanin, to take control of the new kingdom instead of one of Zawi's sons. Under the reign of Habbus (1019–1038), the Taifa of Granada was consolidated and evolved into one of the most important political forces of al-Andalus. 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. He is also credited with building the Zirid citadel in Granada, located in what is now the Albaicín neighbourhood.

Habbus invaded Cabra and Jaén around 1028–1029, expanding his territory northwards, while also imposing his influence on the Taifa of Almeria to the east. 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. In one such campaign, Habus assembled a coalition of armies from Granada, Almeria, and the Zanata principality of Ecija. They attacked Seville directly on or around 30 August 1036, occupying the nearby towns of Aznalcazar and Tocina and burning down the Triana neighbourhood of the city. By the end of his reign, Habbus had thus secured a kingdom occupying the former provinces of Ilbira, Jaén, and Cabra.

Habbus was succeeded by his son, Badis Ibn Habbus (r. 1038–1073), but his reign started with succession troubles. Various factions opposed him and supported either his cousin, Yaddayr ibn Hubasa, or his youngest brother, Buluggin. He managed to foil a coup attempt thanks to the warnings of his allies. 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. He managed to advance as far as al-Funt (Deifontes), a farmstead north of Granada, but here he was met and defeated by an army from Granada. The Zirids annexed much of his former territory and turned Almeria into a vassal state for several years. In 1039, the Zirids also defeated the Abbadids of Seville in battle near Ecija, in turn gaining some territory to the west. The Zirids formally recognized as caliphs the Hammudids, a dynasty descended from Sulayman al-Musta'in and the rulers of the Taifa of Málaga. Badis nonetheless annexed Málaga in 1056 after Hammudid rule collapsed there, appointing his own son, Buluggin Sayf ad-Dawla, as governor. The reign of Badis thus became the apogee of Taifa Granada's political and economic power.

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. Isma'il was a highly educated member of the former elites of Cordoba who had fled that city after the outbreak of the fitna. He eventually found his way to Granada, where Habbus appointed him his secretary in 1020 and entrusted him with many important responsibilities, including tax collection. He was one of the allies who warned Badis of the coup attempt against him at the start of his reign and he thus became the king's most trusted advisor. Under Badis, Isma'il even took charge of the army.

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. When Badis' elder son Buluggin was killed by poison in Yusuf's palace, Yusuf was widely suspected of plotting the murder. 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. Yusuf's plan was to open the gates of the city when al-Mu'tasim's army arrived, but the plan failed when al-Mu'tasim grew uncertain and decided to turn back his army at the last moment. When Yusuf's plot was subsequently revealed, it provoked a violent retaliation from other factions and from the general population still loyal to the Zirids, resulting in the 1066 Granada massacre, in which Yusuf and his allies were killed and deadly retaliations were extended against the city's Jewish population.

Decline and fall
After these events, the kingdom weakened, exacerbated by frequent wars with the Taifa of Seville and other neighbours. 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. A regent named Simaja was appointed to the young king, the only vizier of Berber origin to serve the Zirid kings of Granada. 'Abdallah's older brother Tamim, the governor of Malaga, declared himself independent. In 1081–1082 Tamim even attacked his brother's territory by land and sea, but he was eventually defeated and then reconciled with his brother.

Around this time, the Taifa kingdoms of al-Andalus, including Granada, also became increasingly dependent on the Christian kings of the northern Iberian Peninsula for military aid, particularly the king of Castile and Léon, Alfonso VI. 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 Zirids were defeated in the Battle of Cabra in 1079 against the forces of Seville. Both sides were aided by Castilian knights, with the Castilian contingent of Seville being led by Rodrigo Diaz de Vivar, later known as El Cid. The constant warfare also led to raised taxes, which added to general discontent. There were frequent rebellions, even by high-ranking officials and governors. 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 kingdom's affairs worsened in the 1080s, as Alfonso's forces began encroaching into al-Andalus and the Berber Almoravids of North Africa began to intervene in the Iberian Peninsula as a result. In 1089, during the second Almoravid expedition to the peninsula, 'Abdallah was coerced into aiding the unsuccessful Almoravid siege of Aledo. After this, he tried to play both sides: keeping up the payments to Alfonso VI while also keeping up relations with the Almoravids. Finally, Granada was captured by the Almoravids in September 1090 (Rajab 483 AH), putting an end to the independent kingdom. 'Abdallah, understanding the military superiority of the Almoravids, surrendered the city to them without a fight. 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.

Society and government
Under Zirid rule the population of Granada was diverse. Political tensions arose between three main groups: the Andalusi Arabs, the Jewish community, and the Sanhaja Berbers. 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. Many people likely moved from Cordoba to Granada during the fitna, seeking to escape the conflict. Historical evidence suggests that a Christian population still existed in the city, though it eventually disappeared in the 12th century.

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. During the second half of the 9th century, many of them moved from the city of Ilbira (Madinat Ilbira) to Granada due to their conflicts with the muwalladūn in Ilbira. The Sanhaja Berbers arrived with the Zirids in the 11th century and made up much of the army and the ruling elites, though they were a minority within the wider population. The memoirs of Abdallah ibn Buluggin state that Jews, who were already settled in the city prior to the arrival of the Zirids, made up the majority of Granada's population in the early Zirid period.

Granada first became an Islamic city under the Zirids, and so it was also in this period that Islamic scholarship first developed in the city. Generally, during Granada's Islamic history, most of the ulama (Islamic jurists and scholars) appeared to be of Arab origin and few names of Berber origin are recorded among them, suggesting that Islamic knowledge was often associated with Arab identity or descent.

The Zirid state in Granada retained important Berber characteristics. For example, a jamā'a, or tribal assembly, was responsible for electing the next ruler from the Zirid dynasty and co-ruled alongside him. Significantly, the language of the court was a Berber language, and this was also spoken in daily life. Women, or at least women of the ruling classes, also played a relatively important role in politics.

Role of the Jews
The Zirid Taifa period was the golden age of the Jewish aristocracy in Granada and for Andalusi Jews more generally. 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." Under the Zirid kings a Jew, Samuel ha-Nagid (Isma'il ibn Nagrilla), commanded an army, something not seen again until modern Israel. 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. The power and status of the Granadan Jews at this time was not only unique in al-Andalus, but in the entire Islamic world.

While the Banu Naghrela (or Banu Nagrilla) family of Samuel ha-Nagid reached the highest office in the kingdom's administration, the Banū 'Ezra family also promoted and sponsored arts and sciences during this century. Samuel also cultivated relations with Jewish communities throughout the Muslim world in North Africa and the Middle East, sending gifts and sponsoring scholars. He paid to send oil to the synagogues of Jerusalem, which was seen as a "royal" virtue. The Granadan Jewish community was in close contact with the Jewish city of Lucena, the most important center for the study of Jewish law.

Difficulties and tensions remained present nonetheless for Jews as a minority group within Al-Andalus. Abdallah ibn Buluggin's memoirs claim that one reason the Zirid kings chose a Jewish vizier was that they preferred to entrust a Jewish aristocrat with power than an Andalusi Arab who may have had loyalties with other Muslim factions. As a non-Muslim dhimmi, Samuel could not officially rise to the position of king in a Muslim state, which also made him a desirable candidate for the otherwise powerful position of vizier. The Jewish community was led by elder patriarchs, among whom political rivalries existed at times. At the end of Habus ibn Maksan's reign in 1038, Samuel, who supported the accession of Badis to the throne, was confronted by another powerful Jewish figure, Yosef Ben Migash, who supported Badis' brother Buluggin instead. When Buluggin died soon after, the Jewish patriarchs who supported him fled to Seville, leaving Samuel as the uncontested leader of the Jewish patriarchs in Granada.

The massacre of 1066, followed later by the arrival of the Almoravids, led to the eventual disintegration of the Jewish community in Granada. A small but significant Jewish minority still existed in the city during the Nasrid period (13th to 15th centuries), until the final expulsion of Jews from Spain in 1492.

Architecture
The architecture of the Taifa kingdoms in al-Andalus perpetuated and elaborated the architectural styles developed under the caliphs of Cordoba, but it also integrated new ideas and techniques from further abroad. The architecture of the Zirids in al-Andalus was influenced by earlier architecture from Cordoba and also seems to have been influenced by the architecture of the Hammadids in North Africa. Several structures in southern Spain today have been dated, or tentatively dated, to the time of the Zirid Taifa kingdom.

The original palace and citadel of the Zirids, known as the al-Qasaba al-Qadima ("Old Citadel"), was located on the hill that is now the Albaicín neighborhood, but it has not been preserved. The surviving Aljibe del Rey ("Cistern of the King"), the largest medieval cistern in the neighbourhood, was originally built to serve this citadel. Nearby, the inner northern walls of the city, which run along the top of the Albaicín today, also date from this period. The Alcazaba of Granada, a fortress on the Sabika hill, was first built under the Zirids. Although it was later rebuilt and incorporated into the Alhambra of the Nasrids, traces of the original Zirid fortress remain.

Downhill from the former citadel and near the Darro River is the Bañuelo, a public baths complex originally known as the Hammam al-Yawza. 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. (Although more recent studies have argued that the building dates from the 12th century or later. )

The Zirids are also believed to have constructed the Great Mosque (congregational mosque) of Granada, whose site is now occupied by the present-day Cathedral. One Arabic historical text records that its minbar was completed in the year 1055. In the Albaicín, the bell tower of what is now the Church of San José was originally a minaret and is traditionally dated to the Zirid period. It belonged to a mosque known as the al-Murābiṭīn Mosque (the Mosque of the Marabouts or "Almoravid" Mosque).

Beyond Granada, the Alcazaba of Malaga was also built during the Taifa period in the 11th century, though it was significantly remodelled under the later Nasrids. The limited elements that have survived from the 11th century were likely built by both the Zirids and by the Hammudids from whom they conquered the city.

List of rulers
The four Zirid kings of Granada were:
 * Zawi ibn Ziri: 1013–1019
 * Habbus ibn Maksan al-Muzaffar: 1019–1038, nephew of Zawi
 * Badis ibn Habbus: 1038–1073, son of Habbus
 * Abdallah ibn Buluggin: 1073–1090, grandson of Badis