محمود الغزنوي
In 1002, Mahmud of Ghazni invaded Sistan, dethroned Khalaf I and finally ended the Saffarid dynasty.