He was originally from a
Kurdish village in
Armenia near the city of
Dvin. He was the son of Shadhi ibn Marwan, a
Kurdish chief, and the brother of
Najm ad-Din Ayyub, the ancestor of the
Ayyubid dynasty. The family was closely connected to the
Shaddadid dynasty, and when the last Shaddadid was deposed in Dvin in 1130, Shahdi moved the family first to
Baghdad and then to
Tikrit, where he was appointed governor by the regional administrator Bihruz. Ayyub succeeded his father as governor of Tikrit when Shahdi died soon after. When Shirkuh killed a man who was a Christian in some versions of the story, and with whom he was quarrelling in Tikrit in 1138, alternatively, Shirkuh might have killed that man due to insulting or sexual assault on a young woman, the brothers were exiled (Shirkuh's nephew Yusuf, later known as Saladin, was supposedly born the night they left). They joined
Nur ad-Din Zengi's army, and Shirkuh served under
Nur ad-Din Zengi who succeeded Zengi in
Mosul. Shirkuh was later given
Homs,
ar-Rahba and other
appanages by Nur ad Din Zengi as his vassal. Ayyub served as governor of
Baalbek and later
Damascus, and the two brothers negotiated the surrender of Damascus to Nur ad-Din in 1154. In 1163, Nur ad-Din was asked by
Shawar to intervene in Egypt in a dispute between him and
Dirgham over the
Fatimid vizierate. Nur ad-Din sent Shirkuh, and this was to be the first of three ventures Shirkuh made into Egypt. These nominally on Nur ad-Din's behalf, who gave him a grant of 200,000
dinars and allowed Shirkuh to select 2,000 soldiers from his regiments (aksar) with campaign
materiel and another special grant of 20 dinars for each soldier. He also had 8,000 horsemen, including 500
mamluks and Kurds, from his own regiment from his appanage of
Homs. Shirkuh used his grant to hire 6,000
Turkmen cavalry, commanded by Aineddawla Yaruqi. On this first occasion, his nephew Saladin accompanied him as an advisor. Shawar was restored and Dirgham was killed, but after quarrelling with Shirkuh, Shawar allied with
Amalric I of Jerusalem, who marched into Egypt in 1164 and besieged Shirkuh at
Bilbeis (see
Crusader invasion of Egypt). In response Nur ad-Din attacked the
Crusader states and almost captured the
Principality of Antioch. ==Later career==