In his lifetime, Sebuktegin had resolved that his younger son, Ismail would be enthroned as the ruler. However, his elder son, Mahmud who had a potent and strong character did not obey to this resolution and he was involved within the struggles. He defeated Ismail and ascended the throne of Gazneli State. Furthermore, he had delivered prayers in the name of Abbasi Caliph el-Kadir Billah who was not recognised by the Samani State. The Caliph granted him the title of Yemîn ed-Devle Emîn el-Mille. On the other hand, the Samani State was on the verge of dissolution. As a matter of fact, Karahanli State abolished this state in the year of 999. Gazneli State and Karahanli State shared the lands of this state. Mahmud strengthened his dominion in Khorasan and then established dominion in the border regions of Samani State, in other words, in Sistan, Cuzcan, Huttal and Harezm. Afterwards, Mahmud tried to establish dominion in the region of Gur where idol worship was the dominant factor.
He organised two expeditions to this region with the first one in 1011 and the second one in 1020 and some local chiefs were forcibly subjected to obedience. Some Muslim preachers were left in the region that would teach the principles of the religion of Islam. However, Gur could not ever be subjected to the dominion of the Gazneli State and the diffusion of Islam in this region could follow a ponderous path. Sultan Mahmud established dominion over most of the lands pertaining to Samani State and then, he started to organise expeditions to India and diffuse the religion of Islam to these regions. The capital city of Gazne that was newly developing was located on a hill of a high plateau that overlooked the savannas of the northern India. This strategic location of Gazne provided great ease for the realisation of these expeditions. Mahmud arranged seventeen military expeditions to India and these expeditions provided great wealth and affluent for his sultanate.
The most important expedition of Sultan to India was the Somnat expedition in 1025-6. The echoes of the victory that he had won after this military expedition were diffused among the Islam world with a rapid speed and it enabled Sultan Mahmud to become the hero od the Sunnite Islam world. Abbasi Caliph entitled the sultan and his family with new honorary titles. Sultan Mahmud had sometimes fought with Karahanli State and establish dominion on this state (see Karahanli State section). In the last years of his life, he gave permission for the Turkmens to pass over the River Oxus (Ceyhun) and settle in Khorasan. But afterwards, he defeated the Turkmens upon the disturbance of the regional people by the Turkmens. However, the permission given to Turkmens for settlement in Khorasan had posed a terrible threat in respect of the future of the Gazneli State. Mahmud had expanded the state in the western direction and defeated the Büveyhi people in Iraq. Then, he captured and added the lands of Iraq-Acem to the boundaries of his empire. Sultan Mahmud died in Gazne in the year of 1030. It has been rumoured that the ruler who used the title of Sultan for the first time in history was Mahmud. According to his contemporaries, he had acquired fame upon the dissemination of the religion of Islam in India.
