Ayn-al-Qużāt Hamadānī, also spelled Ain-al Quzat Hamedani or ʿAyn-al Qudat Hamadhani (1098–1131) (Persian: عین القضات همدانی), full name: Abu’l-maʿālī ʿabdallāh Bin Abībakr Mohammad Mayānejī (Persian: ابوالمعالی عبدالله بن ابیبکر محمد میانجی), was a Persianjurisconsult, mystic, philosopher, poet and mathematician who was executed at the age of 33.
Ayn-al-Qużat in Arabic means "the pearl of the judges". As Ayn means the eye or something very valid and Qozat is the plural of Qadi which means Judge.
He was born in Hamedan and his ancestors were of Hamedan judges. He was a disciple of Ahmad Ghazali and devoted of Hallaj. He became a famous scholar at early ages, and by the time he was thirty he was chosen judge. Along with Abu Hamed Al-Ghazali, he is one of the founders of doctrinal Sufism. Unlike most of the Sufis who have lived as respected and revered members of their communities, he fell afoul of Caliph in Baghdad and was put to death at the age of thirty three. Ayn al-Quzat along with Mansur al-Hallaj and Shahab al-Din Suhrawardi are known as the three martyrs of Sufism.
The most significant works of Ayn al-Qożāt are Tamhīdāt (Preludes) and Zubdat al-ḥaqāʾiq fī kašf al-ḵalāʾeq (The Essence of Truth). Both books are masterpieces of Sufi literature and have mystical and philosophical significance. Ayn al-Qożāt Hamadānī quoted a few verses apparently in his own Iranian dialect (where it is called fahlavī; bayt-e pahlavī in a manuscript variant).