King Solomon needed the Shamir, a creature no larger than a barley grain but strong enough to split any stone, because the Torah forbade iron tools on the Temple's stones. To find it, he had to capture Ashmedai, king of the demons.
Three days after Ashmedai was brought in chains to Jerusalem, he was led before the king. The demon measured off four cubits on the floor with his staff and said, "When you die, Solomon, you will possess in this world no more than these four cubits of earth. You have conquered the world and were not satisfied until you conquered me as well."
Solomon answered him quietly. "I want nothing from you. I wish only to build the Temple, and I need the Shamir."
Ashmedai shrugged. "The Shamir is not in my charge. It is entrusted to the Prince of the Sea, who entrusts it only to the great wild cock, and even then only under oath that the bird will return it."
"And what does the wild cock do with it?" Solomon asked.
"He carries it to a barren mountain," the demon replied, "splits the rock with it, and drops seeds of trees and plants into the cleft. That is how desolate places become green and fit for habitation." This, the sages explain, is the same nagger tura, the mountain splitter, named among the creatures of Leviticus 11 and rendered so in the Targum.
Even demons, in Solomon's court, served a sanctuary built without the sound of iron.