In the most glorious period of Samani State (1005), crowded Turkish groups were brought to the world of Islam over the Transoxania. Most of these groups were commissioned as soldiers or the troop of guardsmen in the service of Abbasi Caliphs, the Arabian or Iranian governors in the provinces. Therefore, Turkish soldiers had gradually entered into the eastern and central sections of the Islam world in the 9th and 10th centuries. Meanwhile, the two strong dynasties in Iran that were called as Büveyhi people and Samani people had started to use Turkish soldiers in addition to their local forces. As a result, Turkish names were encountered among the governors and commanders of the Samani State after the year of 912. These Turks constituted a distinguished class as the military leaders and governors in Iranian world. When the authority of the central government was attenuated, these Turkish commanders would seize the power and authority within the state and dominate the state in a half-independent status. When Samani State started to decline, Simcuri people and some Turkish families and commanders such as Kara Tegin Isficabi and Baytuz, etc. established dominion in the region.

As a matter of fact, Gazneli people pertained to one of the Turkish families that got the benefit of the dissolution of Samani State and the era of the rebellions in the palace and emerged under these circumstances. Alptegin, the commander of Khorasan armies who was one of the most significant characters of Turks within the Samani State collaborated with the Vizier Ali Mohammed Bel'ami in 961 and wanted to enthrone his candidate to the throne of Samani State forcibly. But he could not realise this desire. Pursuant to this failure, Alptegin had to retreat to the city of Gazne in the Eastern Afghanistan together with his attendant force that was too weak. He eliminated the Levik people that was a local dynasty in the region and dominated the aforesaid city (962). Therefore, he had laid the foundation of the Gazneli State. We have stated before that Turks had lived in this region of Afghanistan that included the city of Gazne before the Islam. Therefore, the Gazneli State did not only depend on the Turkish soldiers that Alptegin brought with him. Of course, those who had come to the region before constituted a base for the state, and then, the Turks who came from the north provided the development of Gazneli State.

Levik Dynasty did not igve up Gazne easily, so this city was captured in the period of Alptegin's son, Ebu Ishak (960) who had replaced him. Ebu Ishak reestablished dominion in Gazne through the support of Samani Emir. Therefore, Samani State established dominion upon this region at least by name. Since Ebu Ishak Ibrahim did not have any sons, we have observed that Turkish commanders ruled the state pursuant to his death. The first one of these commanders was Bilge Tegin. Bilge Tegin died in the course of the blockade of Gerdiz Castle (974-5), and Bori Tegin (or Piri Tegin) replaced him. However, the dominion of Bori Tegin in Gazne did not last for long, and the Turks dismissed him from his post due to his incapacity. Instead of him, Sebuktegin who was one of the most reliable supporters of Alptegin was enthroned as the ruler (977).