Mahmood of Ghazni, the most prominent ruler of the Ghaznavid Empire, invaded and plundered India seventeen times between 1000 and 1027 A.D. In 1027 AD, he invaded the famous Somnath temple in Gujarat. The main aim of his frequent invasions was to obtain wealth.