Asmodeus told Solomon that the shamir was given by God to the Angel of the Sea, and that Angel entrusted none with the shamir except the moor-hen, which had taken an oath to watch the shamir carefully. The moor-hen takes the shamir with her to mountains which are not inhabited by men, splits them by means of the shamir, and injects seeds, which grow and cover the naked rocks, and then they can be inhabited.

Solomon sent one of his servants to seek the nest of the bird and lay a piece of glass over it. When the moor-hen came and could not reach her young, she flew away and fetched the shamir and placed it on the glass. Then the man shouted, and so terrified the bird that she dropped the shamir and flew away. By this means the man obtained possession of the coveted shamir, and bore it to Solomon. But the moor-hen was so distressed at having broken her oath to the Angel of the Sea that she committed suicide.