Sultan Mahmud of Ghazni was a ruler of Afghanistan from 997 to 1030. He was an ambitious king and so made all efforts to extend his control over far-off regions. He extended his control over parts of Central Asia, Iran and the northwestern part of the subcontinent. Almost every year he raided the subcontinent targeting wealthy temples. The temple of Somnath in Gujarat was the worst victim of his raids. Much of the wealth he carried away was used to create a splendid capital city at Ghazni. Ghazni was fond of knowing more about the people he conquered. He entrusted a scholar named Baruni to write an account of the subcontinent. The al- Barni's account, an Arabic work titled Kitab al-Hind, is still an important source for historians.