Somnath at Somnath Patan, near Veraval in Gujarat is a pilgrimage center held in great reverence throughout India. Somnath is considered to be the first of the 12 Jyotirlingas of Shiva. Somnath is situated on the south coast of Saurashtra.
The Skanda Purana, in a chapter on Prabhasa Khanda, describes Somnath. Legend has it that Shiva in the previous aeons was referred to as Mrityunjaya, Kaalagnirudra, Amritesa, Anamaya, Kritivasa and Bhairavanatha at Somnath.
Legend has it that the Kalabhairava Shivalinga (Bhairavanatha) at Prabhasa was worshipped by the moon, and hence Shiva here is referred to as Somnatha. The Skanda Purana describes the Sparsa Linga of Somnath as one bright as the sun, the size of an egg, lodged underground. The Mahabharata also refers to the Prabhasa Kshetra and the legend of the moon worshipping Shiva.
Legend goes that the moon was married to the 27 daughters of Daksha Prajapati. He was partial to Rohini, his favorite and neglected the others. An angered Daksha cursed him to wane into nothingness. A disturbed Chandra, came down to Prabhasa with Rohini and worshipped the Sparsa Linga of Somnath after which he was blessed by Shiva to grow and shine in the bright half. As the moon regained his light here, this town came to be known as Prabhasa. Bhrama, one of the trinity, installed the Bhramasila, and paved way for the construction of the temple.
The glory and wealth of Somnath was described by the Arab traveller Al Biruni, and his accounts prompted a visit by Mahmud of Ghazini who ransacked and destroyed the temple in 1025 CE. It was immediately rebuilt by King Bhima of Gujarat and King Bhoja of Malwa. This temple was destroyed again by Alaf Khan, the general of Allauddin Khilji in the year 1300 CE. It was rebuilt again by King Mahipala of the Chudasama dynasty.This shrine was destroyed again and yet again in 1390, 1490 , 1530 and finally in 1701 by Aurangazeb. It was rebuilt with perseverence each time after it was destroyed.
In the year 1783, Queen Ahilyabhai Holkar built a new temple nearby, and in 1951, the president of India re-installed the Jyotirlingam of Shiva on the same Bhramasila on which earlier temples had been built.