commanders was Sebüktigin, who governed Ḡazna for twenty years till 387 AH/997 CE with the title (as it appears from his tomb inscription) of al-ḥājeb al-ajall (most noble commander). He would later be the founder of an independent dynasty based in Ghazna, following the decline of the Samanid Empire in the 990s. Decline and fall (961–999) The power of the Samanids began to crumble in the latter half of the 10th century. In 962, one of the ghulams, Alp Tigin, commander of the army in Khorasan, seized Ghazna and established himself there. His successors, however, including Sebük Tigin, continued to rule as Samanid "governors". With the weakened Samanids facing rising challenges from the Karakhanids for control of Transoxiana, Sebük later took control of all the provinces south of the Oxus and established the Ghaznavid Empire. In 992, a Karakhanid, Harun Bughra Khan, grandson of the paramount tribal chief of the Karluk confederation Sultan Satuq Bughra Khan, captured Bukhara, the Samanid capital. Harun died shortly afterwards, however, and the Samanids returned to Bukhara. In 999, Nasr b. Ali, a nephew of Harun, returned and took possession of Bukhara, meeting little resistance. The Samanid domains were split up between the Ghaznavids, who gained Khorasan and Afghanistan, and the Karakhanids, who received Transoxiana; the Oxus River thus became the boundary between the two rival empires. Isma'il Muntasir's attempt to resurrect the Samanid state (1000–1005) Isma'il Muntasir was the youngest son of Nuh II—he was imprisoned by the Karakhanids after their conquest of Bukhara in 999. Some time later, Isma'il managed to escape to Khwarazm, where he gained support. Driving the Karakhanids out of Bukhara, he then moved on to and captured Samarkand. The approach of the Karakhanid army, however, forced Isma'il to give up all of his possessions, following which he travelled to Khorasan, where he captured Nishapur. Mahmud's army, however, made its way to the region, and Isma'il decided it necessary to flee again. In 1003 Isma'il came back to Transoxiana, where he requested and received assistance from the Oghuz Turks of the Zarafshan valley. They defeated the Karakhanids in several battles, even when Nasr Khan was involved. For various reasons, however, Isma'il came to feel that he could not rely on the Oghuz to restore him, so he went back to Khorasan. He tried to gain Mahmud's support for a campaign to restore the Samanid state, but failed. Some time afterwards,