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.
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.
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.
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.