Ibn ʿAbd Rabbih or Ibn ʿAbd Rabbihi (Ahmad ibn Muhammad ibn `Abd Rabbih) (860–940) was a Moorish writer and poet widely known as the author of Al-ʿIqd al-Farīd (The Unique Necklace).
He was born in Cordova, now in Spain, and descended from a freed slave of Hisham I, the second Spanish Umayyad emir. He enjoyed a great reputation for learning and eloquence. Not much is known about his life. According to Isabel Toral-Niehoff,
He came from a local family whose members had been clients (mawālī) of the Umayyads since the emir Hishām I (788–796). His teachers were Mālikī fuqahāʼ and muḥaddithūn who had travelled to the East in search of knowledge: Baqī b. Makhlad (816–889), Muḥammad b. Waḍḍāḥ (815–899), and a scholar named Muḥammad b. ʻAbd al-Salām al-Khushanī (833–899), who is said to have introduced much poetry, akhbār and adab from the Islamic East to Andalusia. Ibn ʻAbd Rabbih himself is said to have never left the Peninsula. In spite of his education as faqīh, he became more a man of letters than a jurist, and functioned as a court poet since the start of the emir ʻAbdallāh’s (888–912) reign. He reached the apogee of his career at the court of caliph ʻAbd al-Raḥmān III (912–961).
Ibn ʿAbd Rabbih was a friend of many Umayyad princes and was employed as an official panegyrist at the Umayyad court. No complete collection of his poems is extant, but many selections are given in the Yatima al-Dahr and Nafh al-Tip.
More widely known than his poetry is his great anthology, the al-ʿIqd al-Farīd (The Unique Necklace), a work divided into 25 sections. The 13th section is named the middle jewel of the necklace, and the chapters on either side are named after other jewels. It is an adab book resembling Ibn Qutaybah's `Uyun al-akhbar (The Fountains of Story) and the writings of al-Jahiz from which it borrows largely. Although he spent all his life in al-Andalus and did not travel to the East like some other Andalusian scholars, most of the his book's material is drawn from the East Islamic world. Also, Ibn Abd Rabbih quoted no Andalusian compositions other than his own. He included in his book his 445-line Urjuza, a poem in the meter of the rajaz in which he narrates the warlike exploits of Abd al-Rahman al-Nasir, along with some of his eulogies of the Umayyads of al-Andalus.