The story of the swayambhu statue handed down from generations through word of mouth, goes something like this: When the Shepherd touched the stone with a pointed rod, the stone started bleeding.
He told the shepherd that he is "Shanaishwara".