He rose to power as a young prince when the Kilab tribe entrusted him and his cousin, Mani, to regain possession of Aleppo after it was given to the Fatimids by his uncle, Thimal.
Clashes followed between Mahmud and his uncle; Atiyya decided to call 1,000 Turcoman archers from Diyarbakır to aid him—the first free Turks to enter Syria.
After Atiyya's supporters pillaged the Turcoman camp, their chief, Ibn Khan, decided to serve Mahmud—which proved decisive.
[2] In 1070 Mahmud appealed to Alp Arslan, the Seljuk Sultan, to control the Turcomans who were constantly increasing in number and were creating disorder in and around Aleppo.
However, his oldest son, Nasr, whose mother was the daughter of the Buyid emir Jalal al-Dawla, was recognised as his successor.