After his accession to the throne, a peculiar quarrel among heirs was brought before Solomon for adjudication. Asmodeus, the king of demons, once said to Solomon: "Thou art the wisest of men, yet I shall show thee something thou hast never seen." Thereupon Asmodeus stuck his finger in the ground, and up came a double-headed man. He was one of the Cainites, who live underground, and are altogether different in nature and habit from the denizens of the upper world.
When the Cainite wanted to descend to his dwelling-place again, it appeared that he could not return thither. Not even Asmodeus could bring the thing about. So he remained on earth, took unto himself a wife, and begot seven sons, one of whom resembled his father in having two heads. When the Cainite died, a dispute broke out among his descendants as to how the property was to be divided.
The double-headed son claimed two portions. Both Solomon and the Sanhedrin were at a loss; they could not discover a precedent to guide them. Then Solomon prayed to God: "O Lord of all, when Thou didst appear to me in Gibeon, and didst give me leave to ask a gift of Thee, I desired neither silver nor gold, but only wisdom, that I might be able to judge men in justice."