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, 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, 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, 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.