Somnath Jyotirlinga Temple: According to the legend, Soma or the Moon God built the temple in gold, Ravana in silver, and Shri Krishna in wood. Soma was cursed by his father-in-law Daksha to wane because Soma loved only one of his wives, all of whom happened to be Daksha's daughters. His other wives complained about this negligent behavior of Soma to their father Daksha, and thus the curse. He then built a Shivlinga at the Prabhas tirth (a Hindu pilgrimage) and prayed to Lord Shiva who removed the curse partially because asked upon by Soma's one wife (the one that he loved more than others).Thus, causing the periodic waning of moon. Pleased by the prayers Soma (Moon god), Lord Shiva decided to rest in that Lingam till eternity, and thus the Jyotirlinga.
· The first temple of Somnath is said to have existed before the beginning of the Common Era.
· The second temple, built by the Yadava kings of Vallabhi in Gujarat , replaced the first one on the same site around.
· In 725 Junayad, the Arab governor of Sind sent his armies to destroy the second temple. The Gurjara Pratihara king Nagabhata II constructed the third temple in, a large structure of red sandstone.
· In 1024 AD, the temple was once again destroyed by Mahmud Ghazni who raided the temple from across the Thar Desert . The temple was rebuilt by the Gujjar Paramara King Bhoj of Malwa and the Solanki king Bhīma of Gujarat (Anhilwara) or Patan between 1026 and 1042. The wooden structure was replaced by Kumarpal (r.1143-72), who built the temple of stone.
· In 1296 AD, the temple was once again destroyed by Sultan Allauddin Khilji's army. According to Taj-ul-Ma'sir of Hasan Nizami, Raja Karan of Gujarat was defeated and forced to flee, "fifty thousand infidels were dispatched to hell by the sword" and "more than twenty thousand slaves, and cattle beyond all calculation fell into the hands of the victors". The temple was rebuilt by Mahipala Deva, the Chudasama king of Saurashtra in 1308 AD and the Linga was installed by his son Khengar sometime between 1326 and 1351 AD.
· In 1375 AD, the temple was once again destroyed by Muzaffar Shah I, the Sultan of Gujarat.
· In 1701 AD, the temple was once again destroyed by Mughal Emperor Aurangzeb. Aurangzeb built a mosque on the site of the Somnath temple, using some columns from the temple, whose Hindu sculptural motifs remained visible.
Queen Ahilya Bai Holkar of Indore rebuilt the temple in 1783 AD at a site adjacent to the ruined temple which was already converted to a mosque.