Ahmad Sanjar

Ahmad Sanjar (1085-8 May 1157) was Sultan of the Seljuk Empire from 1118 to 1157, succeeding Sultan Mohammed of Seljuk Sultanate. He was the longest-reigning Muslim ruler until the arrival of the Mongol Empire, as well as the last ruler of the Seljuk Empire; the Seljuks ruled only Iraq and Azerbaijan after his death, and the empire fragmented.

Biography
Ahmad Sanjar was born in 1085 in Sinjar, Iraq, the son of Malik Shah. He participated in wars of succession with his three brothers Mahmud I of Great Seljuk, Barkiyaruq, and  Sultan Mohammed of Seljuk Sultanate  and his nephew  Malik Shah II. In 1096, he was granted Khorasan by his brother Mohammed, and in 1102 he repulsed an invasion of Kashgaria while also attempting to crush the Hashshashin of Alamut. He drove them from a number of their strongholds, and Mentor Hassan-i Sabbah agreed to make peace with Sanjar. In 1117, he defeated the Ghaznavids at Ghazni and subjugated them, but in 1141 he was defeated by the Kara-Khitai at Qatwan. The Oghuz Turks complicated matters by sacking Nishapur, and Sanjar died in 1157. His death ended the Seljuk Empire, which fragmented into smaller states as the Seljuks were relegated to controlling just Iraq and Azerbaijan.