Ghaznavid–Saffarid war
In December 999, Mahmud of Ghazni invaded Sistan, ruled by the Saffarids. The last Saffarid ruler, Khalaf ibn Ahmad, carried out campaigns in Ghaznavid territories, capturing Fushanj, Bust, Kuhistan which prompted Ghaznavid Sultan Mahmud to lead campaign against the Saffarids.