 Circumstances became unfavorable in Dvin when Turkish generals seized the town from its Kurdish prince . Shadhi left with his two sons Najm al @-@ Din Ayyub and Asad ad @-@ Din Shirkuh . His friend Mujahed al @-@ Din Bihruz — the military governor of northern Mesopotamia under the Seljuks — welcomed him and appointed him governor of Tikrit . After Shadhi 's death , Ayyub succeeded him in governance of the city with the assistance of his brother Shirkuh . Together they managed the affairs of the city well , gaining them popularity from the local inhabitants . In the meantime , Imad ad @-@ Din Zangi , the ruler of Mosul , was defeated by the Abbasids under Caliph al @-@ Mustarshid and Bihruz . In his bid to escape the battlefield to Mosul via Tikrit , Zangi took shelter with Ayyub and sought his assistance in this task . Ayyub complied and provided Zangi and his companions boats to cross the Tigris River to safely reach Mosul . 
