The Ghaznavid dynasty ( ġaznaviyān) was a Persianate Muslim dynasty of Turkic mamluk origin, at their greatest extent ruling large parts of Iran, Afghanistan, much of Transoxiana and the northwest Indian subcontinent from 977 to 1186. The dynasty was founded by Sabuktigin upon his succession to rule of the region of Ghazna after the death of his father-in-law, Alp Tigin, who was a ex-general of the Samanid Empire from Balkh, north of the Hindu Kush in Greater Khorasan.