When Solomon in his wealth and prosperity grew unmindful of his God, and, contrary to the injunctions laid down for kings in the Torah, multiplied wives unto himself, and craved the possession of many horses and much gold, the Book of Deuteronomy stepped before God and said: "Lo, O Lord of the world, Solomon is seeking to remove a Yod from out of me, (80) for Thou didst write: 'The king shall not multiply horses unto himself, nor shall he multiply wives to himself, neither shall he greatly multiply to himself silver and gold'; but Solomon has acquired many horses, many wives, and much silver and gold." Hereupon God said: "As thou livest, Solomon and a hundred of his kind shall be annihilated ere a single one of thy letters shall be obliterated." (81)
The charge made against Solomon was soon followed by consequences. He had to pay heavily for his sins. It came about in this way: While Solomon was occupied with the Temple, he had great difficulty in devising ways of fitting the stone from the quarry into the building, for the Torah explicitly prohibits the use of iron tools in erecting an altar. The scholars told him that Moses had used the shamir, (82) the stone that splits rocks, to engrave the names of the tribes on the precious stones of the ephod worn by the high priest. Solomon's demons could give him no information as to where the shamir could be found. They surmised, however, that Asmodeus, (83) king of demons, was in possession of the secret, and they told Solomon the name of the mountain on which Asmodeus dwelt, and described also his manner of life. On this mountain there was a well from which Asmodeus obtained his drinking water. He closed it up daily with a large rock, and sealed it before going to heaven, whither he went every day, to take part in the discussions in the heavenly academy. Thence he would descend again to earth in order to be present, though invisible, (84) at the debates in the earthly houses of learning. Then, after investigating the seal on the well to ascertain if it had been tampered with, he drank of the water.
Solomon sent his chief man, Benaiah the son of Jehoiada, to capture Asmodeus. For this purpose he provided him with a chain, the ring on which the Name of God was engraved, a bundle of wool, and a skin of wine. Benaiah drew the water from the well through a hole bored from below, and, after having stopped up the hole with the wool, he filled the well with wine from above. When Asmodeus descended from heaven, to his astonishment he found wine instead of water in the well, although everything seemed untouched. At first he would not drink of it, and cited the Bible verses that inveigh against wine, to inspire himself with moral courage. At length Asmodeus succumbed to his consuming thirst, and drank till his senses were overpowered, and he fell into a deep sleep. Benaiah, watching him from a tree, then came, and drew the chain about Asmodeus' neck. The demon, on awakening, tried to free himself, but Benaiah called to him: "The Name of thy Lord is upon thee." Though Asmodeus now permitted himself to be led off unresistingly, he acted most peculiarly on the way to Solomon. He brushed against a palm-tree and uprooted it; he knocked against a house and overturned it; and when, at the request of a poor woman, he was turned aside from her hut, he broke a bone. He asked with grim humor: "Is it not written, 'A soft tongue breaketh the bone?'" A blind man going astray he set in the right path, and to a drunkard he did a similar kindness. He wept when a wedding party passed them, and laughed at a man who asked his shoemaker to make him shoes to last for seven years, and at a magician who was publicly showing his skill.
Having finally arrived at the end of the journey, Asmodeus, after several days of waiting, was led before Solomon, who questioned him about his strange conduct on the journey. Asmodeus answered that he judged persons and things according to their real character, and not according to their appearance in the eyes of human beings. He cried when he saw the wedding company, because he knew the bridegroom had not a month to live, and he laughed at him who wanted shoes to last seven years, because the man would not own them for seven days, also at the magician who pretended to disclose secrets, because he did not know that a buried treasure lay under his very feet; the blind man whom he set in the right path was one of the "perfect pious," and he wanted to be kind to him; on the other hand, the drunkard to whom he did a similar kindness was known in heaven as a very wicked man, but he happened to have done a good deed once, and he was rewarded accordingly.
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, (85) 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.
Although Asmodeus was captured only for the purpose of getting the shamir, Solomon nevertheless kept him after the completion of the Temple. One day the king told Asmodeus that he did not understand wherein the greatness of the demons lay, if their king could be kept in bonds by a mortal. Asmodeus replied, that if Solomon would remove his chains and lend him the magic ring, he would prove his own greatness. Solomon agreed. The demon stood before him with one wing touching heaven and the other reaching to the earth. Snatching up Solomon, who had parted with his protecting ring, he flung him four hundred parasangs away from Jerusalem, and then palmed himself off as the king.