They were ultimately deposed by the ruler of the Ghaznavid Empire, Sultan Mahmud ().
This sentence describes a political event where the rulers were overthrown by Sultan Mahmud, the leader of the Ghaznavid Empire.