According to the legend, Somnath is as old as creation, built by none other than the Moon God himself. Somnath was destroyed and rebuild several times. Mehmud of Gazni having heard of its fabulous treasure, raided it in 1026 and carried away camel-loads of jewels and gold.
This is the first among the twelve Jyotirlings. Since ancient times, Prabhas Patan has been a pilgrimage, being the confluence of the mythological Saraswati, Hiranya and Kapila. Legend has it that Lord Shiva's Kalbhairav linga is situated at Prabhas. It is also associated with the moon as the Moon God is also said to have worshipped this Shivling. This is also the reason why this temple is popularly known as Somnath, the one named after the moon.
Remains found from the region and descriptions in the writings of Indians and foreigners suggest that the place was a colony of the Aryans in the ancient times. This temple of religious as well as historical significance is believed to have been built sometime around AD 4.
In AD 1026, Mahmud of Ghazni first looted the temple, and then came Afzal Khan, the commander of Ala-ud-din Khilji and later Aurangzeb. It is said that the temple was looted and destroyed as many as seventeen times.
The Iron man of India, Sardar Vallabhbhai Patel was instrumental in the construction of the present temple, an edifice reminding visitors of the splendor of the original Somnath temple. Renowned temple architect Prabhaschandar designed it and the first President of India Dr. 2
Rajendra Prasad installed the Jyotirling in the new temple on May 11, 1951