This is from Afghan Caravan and was condensed from "Aghanistan of the Afghans" by Sirdar Ikbal Ali Shah.
"Sultan Mahmud & the temple of Somnath"
In Ghazni they say that Sultan Mahmud, another Afghan emperor, on his seventeenth invasion of India plundered and ransacked the temple of the rich Somnath. There stood an idol of gigantic height in the center of the temple. This was made of gold and was hollow, and the worshippers used to drop thier offerings of jewels into it's mouth. Mahmud struck the idol with a hammer, and when his officers beseeched him to spare the idol and accept money from its worshippers, he replied that on the Day of Judgement he would like to be called, "Mahmud the idol breaker" and not "Mahmud the idol seller."
Cartloads of rubies and diamonds, gold and silver, fell out in a torrent from the idol's interior when Mahmud struck it. The wealth was brought to Ghazni, and a portion of it was ordered to be placed in the Juma Mosque, while two other pieces were sent to Mecca and Medina in Arabia, to be used as steps of the mosques. The idolators, it is said, came to Ghazni and sent a petition to Mahmud to say that the jewels of thier idol might be retained by the King, but the idol should be exchanged for money.
Mahmud, they say, ordered the idol reduced to powder, and that powder, mixed with flour, made the bread for the Hindus at night. The next morning Mahmud said in reply that he had no idol left, for they had eaten up the object of devotion in thier bread the preceding night.
For many centuries the matter rankled, and when the British invaded Afghanistan, one of thier aims was to recapure the gates of Somnath, which had been carried off, and restore them to thier rightful Hindu owners in India. A pair of huge gates were found and were brought back with great ceremony. It was soon determined, however, that they were the wrong ones.