Mahmud of Ghazni (, ; (2 November 971 – 30 April 1030) was the ruler of the Ghaznavid Empire from 997 until his death. He turned the former provincial city of Ghazni into the rich capital of an extensive empire which included modern-day Afghanistan, most of Iran, and parts of north-west India including modern-day Pakistan. He was also the first ruler to carry the title Sultan, signifying his break from the power of the Islamic Caliph.