Mahmud Ghaznavi invaded on Somnath temple in 1025 CE. This was his sixteenth invasion. Receiving the news of arrival of Mahmud the Raja Bhimdev fled from the capital along with his followers, but the common people and priests of Somnath remained undeterred at their places because they were sure that due to the presence of Lord Somnath, they were absolutely safe. The people of Somnath opposed the invaders on the first day in such a violent way that they were forced to move back.
On the second day, the army of the enemy became successful in crossing the walls of the city. Mahmud occupied the city without any opposition and ordered for mass killing. More than 50,000 men and women were put to death. After gaining victory, Mahmud himself broke the statue of Somnath and sent its pieces to Ghazni, Mecca and Madina and settled them under the staircases of the main mosque.