1At that time Judah went down from his brothers and turned aside to an Adullamite named Hirah. 2There Judah saw the daughter of a Canaanite man named Shua. He took her and went in to her. 3She conceived and bore a son, and he named him Er. 4She conceived again and bore a son, and she named him Onan. 5Once more she bore a son, and she named him Shelah. Judah was in Chezib when she bore him.
6Judah took a wife for Er his firstborn, and her name was Tamar. 7But Er, Judah’s firstborn, was wicked in the sight of the LORD, and the LORD put him to death. 8Then Judah said to Onan, “Go in to your brother’s wife and fulfill the duty of a brother-in-law to her, and raise up offspring for your brother.” 9But Onan knew that the offspring would not be his. Whenever he went in to his brother’s wife, he spilled it on the ground, so as not to give offspring to his brother. 10What he did was wicked in the sight of the LORD, and he put him to death also. 11Then Judah said to Tamar his daughter-in-law, “Remain a widow in your father’s house until my son Shelah grows up.” For he thought, “He too might die like his brothers.” So Tamar went and lived in her father’s house.
12After many days Shua’s daughter, Judah’s wife, died. When Judah was comforted, he went up to Timnah to the shearers of his flock, he and his friend Hirah the Adullamite. 13Tamar was told, “Your father-in-law is going up to Timnah to shear his flock.” 14So she took off her widow’s garments, covered herself with a veil, wrapped herself, and sat at the entrance to Enaim, which is on the road to Timnah. For she saw that Shelah had grown up, and she had not been given to him as a wife. 15When Judah saw her, he thought she was a prostitute, for she had covered her face. 16He turned aside to her by the road and said, “Come, let me go in to you,” for he did not know that she was his daughter-in-law. She said, “What will you give me if you go in to me?” 17He said, “I will send a young goat from the flock.” She said, “Will you give me a pledge until you send it?” 18He said, “What pledge shall I give you?” She said, “Your seal and your cord, and the staff in your hand.” So he gave them to her and went in to her, and she conceived by him. 19Then she got up and went away. She took off her veil and put on her widow’s garments.
20Judah sent the young goat by his friend the Adullamite to recover the pledge from the woman, but he did not find her. 21He asked the men of her place, “Where is the shrine prostitute who was at Enaim by the road?” They said, “There has been no shrine prostitute here.” 22So he returned to Judah and said, “I did not find her. And the men of the place also said, ‘There has been no shrine prostitute here.’” 23Judah said, “Let her keep the things, or we will become a laughingstock. Look, I sent this young goat, and you did not find her.”
24About three months later Judah was told, “Tamar your daughter-in-law has played the prostitute, and now she is pregnant by prostitution.” Judah said, “Bring her out and let her be burned.” 25As she was being brought out, she sent word to her father-in-law: “I am pregnant by the man who owns these.” She said, “Please identify whose seal and cords and staff these are.” 26Judah recognized them and said, “She is more righteous than I, because I did not give her to my son Shelah.” And he did not know her again.
27When the time came for her to give birth, there were twins in her womb. 28As she was giving birth, one put out a hand, and the midwife took a scarlet thread and tied it on his hand, saying, “This one came out first.” 29But as he drew back his hand, his brother came out. She said, “What a breach you have made for yourself!” So he was named Perez. 30Afterward his brother came out with the scarlet thread on his hand, and he was named Zerah.