Background
Having studied there and in Baghdad, he taught first in the Academy at Baghdad and later in his native town. He made the pilgrimage to Mecca in 1188, and having visited Jerusalem, on his return journey he went to Damascus. There he was received by Saladin, the sultan of Egypt, was invited to join his service, and was appointed judge (cadi) of the army of Jerusalem. He enjoyed the full confidence of Saladin, for whom he composed a treatise on the merits of the Holy War against the Crusaders. After Saladin's death in 1193, Baha-al-Din was promoted by Saladin's son al-Malik az-Zahir to high and lucrative office in Aleppo and was treated by him as his personal adviser, a preferment that he continued to enjoy under his successor al-Malik al-Aziz until the latter's abdication. Baha-al-Din thereupon went into retirement. Having no children or near kinsmen, he devoted his considerable fortune to founding and endowing educational establishments in Aleppo, always maintaining his interest in higher learning.