And it was on the night of Abraham's birth, all the servants of Terach came, and all the wise men of Nimrod and his magicians, and they ate and drank and rejoiced in Terach's house. When they left his house, they lifted their eyes heavenward to the stars and saw one very great star coming from the east, and it ran across the sky and swallowed four stars from the four directions of the heavens. They were amazed and said: "This can only mean that the child born to Terach will grow and be fruitful and multiply and inherit all the earth." In the morning they told the king and said: "If it please the king, give his father the price of this child and we shall kill him." Their words pleased him and he called Terach, etc., "Now give me the child and we shall kill him before his thoughts sprout upon us, and I shall give you his price - your house full of silver and gold." Terach answered: "Whatever my lord the king desires, your servant shall do.
But I shall tell you what happened to me yesterday: Ayon son of Morad came to me saying, give me the great good horse that the king gave you and I shall give you its price in silver and gold and fill your house with grain and fodder. But I answered you that the counsel that my lord the king advises, I shall do." The king was angry and considered him a fool and said: "You fool and ignoramus, or are you lacking sense to do this thing?
Are you lacking silver and gold?" etc. Terach answered the king: "Like this matter my lord the king spoke - give your son and we shall kill him and give his price in silver and gold. What shall I do with silver and gold after my son's death? Who will inherit me?
When I die the silver and gold will return to my lord the king." When the king heard Terach's words and the parable he brought before the king, the king was very angry and wrathful and his anger burned within him. Terach was afraid because the king was angry and said: "All that I have is the king's, and also my son is the king's without price, and his two older brothers." The king said: "No, I shall surely buy your youngest son for a price," etc.
Terach said: "Let my lord the king give me three days until I speak to my soul and my house the words of my lord the king," and he pressed them on this matter, etc. He gave him three days, and Terach came to his house and spoke to them the king's words and they feared greatly. On the third day the king sent to Terach: "Send me your son for a price, or else I shall destroy everything in your house and not leave anyone alive." Terach hurried because the king's word was urgent and took one child from his servants whom his maidservant bore him on the day Abraham was born, and brought him to the king and took his price.
The king took the child from Terach's hand and dashed his brains to the ground with his hand and killed him, for he thought it was Abraham. The matter was hidden from that day on and was forgotten from the king's heart, for this was from Hashem so as not to kill Abraham. Terach took Abraham his son secretly and his mother and his nursemaid and hid them in a cave and gave them sustenance month by month, and Hashem was with Abraham and he grew.
He was in the cave for ten years, and the king and his ministers thought that the king had killed Abraham [(Sefer HaYashar). And in the piyyut for the second day of Rosh Hashanah it says that Hashem hid him in the earth for 12 years without seeing the luminaries].