# Taifa of Málaga

The Taifa of Málaga (Arabic: طائفة مالقة) was an Andalusī Islamic taifa kingdom located in what is now southern Spain. It existed during four distinct time periods: from 1026 to 1057, 1073 to 1090, 1145 to 1153, and 1229 to 1239, when the polity was finally conquered by the Emirate of Granada.

## History
### First taifa

The taifa was created in 1026 when Yahya I al-Mu'tali, a Berberized Arab of the Hammudid dynasty who had been invited to assume the title of caliph of Córdoba, returned to his secure stronghold of Málaga and subsequently was banished definitively by the Córdobans. After his expulsion, he united under his rule the coras of Málaga and Algeciras, initially with the support of the Zirids of Granada, and thereupon declared the independent Taifa of Málaga. He regained the title of caliph, which thenceforth was exclusive to the Málagan rulers. His rule, which lasted until his death in 1035, was characterized by struggle with the Abbadid dynasty kings of the Taifa of Seville. Yahya conquered the Taifa of Carmona, of strategic importance in the area; it was, however, soon recaptured by the Sevillans.
At his death in 1035, the kingdom was divided into two independent entities: the taifa of Málaga proper, under his brother Idris I al-Muta'ayyad, and the Taifa of Algeciras, under his nephew Muhammad ben al-Qasim. Struggle against Seville continued, reaching its climax in the Malagan victory in the 1039 Battle of Écija, thanks also to the support of the taifas of Almería, Granada and Carmona. Idris I was succeeded in Málaga by Yahya II al-Qa'im, who lasted only one year, being ousted in 1040 by his uncle Hasan al-Mustansir, in turn overthrown in 1042 by the Saqaliba Naya al-Siqlabi.
In the same year Naya was assassinated, and the Hammudids regained the throne with Idris II al-Ali, brother of Hassan, who reigned until being deposed in 1047 by his cousin Muhammad I al-Mahdi. In 1053 or 1053 the latter was replaced by his cousin Idris III al Sami, who was also assassinated after just one year, after which Idris II held the throne until his death in 1054 or 1055. His son and successor, Muhammad II al-Musta'li, was deposed by his brother, Yahya III al-Mahdi, under which the taifa was conquered in 1057 by Badis ben Habus, Zirid ruler of Granada.
After Badis' death in 1073 and the division of the Granadan taifa between his successors, Málaga went to Tamim ben Buluggin ben Badis while Abd Allah ben Buluggin gained the taifa of Granada. In 1090, the taifa was conquered by the Islamic Almoravid dynasty.

### Second taifa

During the so-called second taifa age, Málaga was self-ruled for eight years starting from 1145, under the Banu Hassun Abu'l-Hakam al-Husayn, who exploited a popular revolt against the Almoravids. His unpopular policies, however, as well as his alliance with the Christians, caused his fall by the hands of the Almohads and his suicide in 1153.

### Third taifa

In 1229, in the course of the third taifa period, Málaga became shortly independent in 1229 under Ibn Zannun, from the Banu Zanum dynasty. His fall in 1238 marked the end of the taifa of Málaga, which was incorporated into the emirate of Granada.

## List of Emirs
### Hammudid dynasty

* Yahya I al-Mu'tali: 1026 or 1027–1035
* Idris I al-Muta'ayyad: 1035–1039
* Yahya II al-Qa'im: 1039–1040
* Hasan al-Mustansir: 1040–1042
* Naya the Usurper: 1042
* Idris II al-Ali: 1042–1047 d. 1054/5
* Muhammad I ben al-Qasim: 1047–1053
* Idris III al Sami: 1053
* Idris II (restored): 1053–1054/5
* Muhammad II al-Musta'li: 1054/5
* Yahya III al-Mahdi (in Melilla 1063–1064): 1054/5–1057/8 d. 1064
** To Taifa of Granada: 1057/8–1073

### Zirid dynasty

* Tamim: 1073–1090
** To Almoravids: 1090–1145

### Hassunid dynasty

* Abu'l-Hakam al-Husayn: 1145–1153
** To Almohads: 1153–1229

### Zannunid dynasty

* Ibn Zannun: 1229?–1239
** To Granada: 1239–1487