Once upon a time, Ravana was doing severe penance in Kailash to please Lord Shiva and obtain the atmalinga. Lord Shiva was pleased with his devotion and decided to reward him. So, Lord Shiva gave him the atmalinga. But he also told Ravana to not place the atmalinga anywhere as it would get fixed immediately to the ground.
Ravana headed back to Lanka to place the atmalinga in his kingdom. But the gods above were worried whether he would use the linga for evil purposes and so they sent Ganesha in disguise to do some mischief and stop Ravana from taking the atmalinga back to Lanka. Ganesha then transforms himself into a boy and goes near Ravana. Now there are two versions of the following incident.
As Ravana was a pious brahmin, he needed to do the Sandhyavandanam ritual during the evening. So, Ravana came across a boy (Ganesha in disguise) and gave it to him, asking him to hold it and return it to him after he had finished his ritual. The boy accepts and takes the atmalinga. Ravana then started his ritual. The boy then after some time, starts calling out to Ravana, saying that he is unable to hold the atmalinga. Ravana is engrossed in his ritual and is unable to hear the boy calling out to him.
The boy however continues to call out to him and finally Ravana says that he will be coming soon. But the boy says that he cannot hold it any longer and places it on the ground. Ravana cries in anguish and tries to lift the atmalinga, but is of no use. Ravana then threatens to punish the boy, and at once the boy reveals his true form. Upon seeing that the boy was none other than Ganesha, Ravana feels helpless and leaves the place. All the gods then shower praises on Ganesha from the heavens above.
Thus, this atmalinga also came to be known as Mahabaleshwar (the one who is strongest) and is located in a town called Gokarna in Karnataka today.