The Ghaznavid Empire
We know from the unconfirmed epic legends that Ghazni (located in Modern Afghanistan) was founded by a King of Yadu Dynsty named Raja Gaj in Post-Vedic Era.
It was incorporated into the Persian Empire in the 6th century AD by Cyrus II, the Achaemenid King. It was a rich Buddhist center up to 7th century AD. Islam was brought here by fanatic Arab armies in 683AD.
It was ruled by a Persian Samanid Empire in the 10th century when the political fallout of this empire led a general of Central Asian Turkic origin from Balkh named AlpTigin cross the Hindukush Mountains and capture it and declare his independence.
Ghazni was actually seized by Subuktgeen, slave and later son-in-law of Alp Tigin.
Subuktgeen founded the Ghaznavid Empire, an strategic empire located between Kabul and Kandhar in Modern Afghanistan.
In 977 AD Subuktgeen captured Kandahar and prompted the Shahi King Jayapala to launch a strike against the rising Ghaznavid Empire. Jayapal’s 1 lakh strong army was defeated and he was compelled to pay heavy tributes. He defaulted in the payments and was again attacked and defeated.
In 1001, Subuktgeen son Mahamud came in Power and once more he attacked the Ghaznavid but defeated. Thus repeated defeats against the Ghaznavid humiliated him and unable to tolerate these humiliations he committed suicide by burning himself in funeral pyre.