Testament of Solomon

It was written in the Greek language, based on precedents dating back to the early 1st millennium AD, but was likely not completed in any meaningful textual sense until sometime in the Middle Ages.

[1][2] In its most noteworthy recensions, the text describes how Solomon was enabled to build his temple by commanding demons by means of a magical ring that was entrusted to him by the archangel Michael.

Mid-twentieth century scholarship tended to agree that much of its content "reflects the first-century Judaism in Israel" and includes material much earlier than its composition.

When a demon named Ornias harasses a young man (who is favored by Solomon) by stealing half of his pay and sucking out his vitality through the thumb on his right hand, Solomon prays in the temple and receives from the archangel Michael a magic ring with the seal of God (in the shape of a pentagram) on it which will enable him to command the demons.

For example, the thirty-third demon is Rhyx Achoneoth who causes sore throat and tonsilitis and can be driven off by writing the word Lycourgos on ivy leaves and heaping them into a pile.

The imprisoned demon calls himself Ephippas, and it is by his power that a cornerstone, thought to be too large to lift, is raised into the entrance of the temple.

There follows a short conclusion in which Solomon describes how he fell in love with a Shunammite woman, and agreed to worship Remphan and Moloch in exchange for sex.

[10] The demon Enepsigos recounts to King Solomon at one point during the temple's construction that he can take three different physical forms, one of which being the Greek Titan Kronos.

The Babylonian Talmud (in Gittin 68) mentions a similar story where Solomon enslaves Ashmedai, a demon prince, to build the Temple, and he was disposed of temporarily by him.