According to the ancient Indian legend, by the curse of his father-in-law Daksha Prajapati, Chandra Bhagwan(Lord Moon) gets released from this Somnath site. Moon was married to twenty-seven daughters of Daksha. However, he favored Rohini only and always ignored the other queens. Due to this, the angry Daksha king cursed Chandra Dev that he would lose the power of his light.
Frightened Chandra Dev went to his father Brahma and with his advice, he reached Prabhas Tirtha and started worshiping Lord Mahadev. Pleased with the austerity and devotion of Chandra Dev, Dev Mahadev relieved him of this curse. According to the Puranic legend, Chandra Dev constructed the temple with gold, after which Ravana made silver, and Lord Shri Krishna built the Somnath temple with sandalwood.