At the end of his reign, Mahmud's empire extended from Kurdistan in the west to Samarkand in the Northeast, and from the Caspian Sea to the Punjab in the west. Although his raids carried his forces across Northern and Western India, only Punjab came under his permanent rule; Kashmir, the Doab, Rajasthan, and Gujarat remained nominal under the control of the local Indian dynasties. In 1030, Mahmud fell gravely ill and died at age 59. As with the invaders of three centuries ago, Mahmud's armies reached temples in Varanasi, Mathura, Ujjain, Maheshwar, Jwalamukhi, Somnath and Dwarka.