Gokarna is an important pilgrimage place for Hindus. According to legend, when Ravana was carrying the 'Atmalinga' of Lord Shiva, which was given to him as a boon, he was forced to keep it on the shore of Gokarna and the lingam got embedded there. The Mahabaleshwara temple of Gokarna has this lingam as its main deity. Shaped like the ears of a cow, the lingam is inside the ground where Lord Ganesha was said to have placed it. There is a temple dedicated to Lord Ganesha too.