1. At that time Judah left his brothers and settled near an Adullamite named Hirah.
2. There Judah saw the daughter of a Canaanite named Shua; he took her as a wife and slept with her.
3. She conceived and gave birth to a son, and he named him Er.
4. She conceived again, gave birth to a son, and named him Onan.
5. She gave birth to another son and named him Shelah. It was at Chezib that she gave birth to him.
6. Judah got a wife for Er, his firstborn, and her name was Tamar.
7. Now Er, Judah's firstborn, was evil in the LORD's sight, and the LORD put him to death.
8. Then Judah said to Onan, "Sleep with your brother's wife. Perform your duty as her brother-in-law and produce offspring for your brother."
9. But Onan knew that the offspring would not be his; so whenever he slept with his brother's wife, he released his semen on the ground so that he would not produce offspring for his brother.
10. What he did was evil in the LORD's sight, so He put him to death also.
11. Then Judah said to his daughter-in-law Tamar, "Remain a widow in your father's house until my son Shelah grows up." For he thought, "He might die too, like his brother." So Tamar went to live in her father's house.
12. After a long time Judah's wife, the daughter of Shua, died. When Judah had finished mourning, he and his friend Hirah the Adullamite went up to Timnah to the sheepshearers.
13. Tamar was told, "Your father-in-law is going up to Timnah to shear his sheep."
14. So she took off her widow's clothes, veiled [her face], covered herself, and sat at the entrance to Enaim, which is on the way to Timnah. For she saw that, though Shelah had grown up, she had not been given to him as a wife.
15. When Judah saw her, he thought she was a prostitute, for she had covered her face.
16. He went over to her and said, "Come, let me sleep with you," for he did not know that she was his daughter-in-law. She said, "What will you give me for sleeping with me?"
17. "I will send you a young goat from my flock," he replied. But she said, "Only if you leave something [with me] until you send it."
18. "What should I give you?" he asked. She answered, "Your signet ring, your cord, and the staff in your hand." So he gave them to her and slept with her, and she got pregnant by him.
19. She got up and left, then removed her veil and put her widow's clothes back on.
20. When Judah sent the young goat by his friend the Adullamite in order to get back the items he had left with the woman, he could not find her.
21. He asked the men of the place, "Where is the cult prostitute who was beside the road at Enaim?" "There has been no cult prostitute here," they answered.
22. So the Adullamite returned to Judah, saying, "I couldn't find her, and furthermore, the men of the place said, 'There has been no cult prostitute here.'"
23. Judah replied, "Let her keep [the items] for herself; otherwise we will become a laughingstock. After all, I did send this young goat, but you couldn't find [her]."
24. About three months later Judah was told, "Your daughter-in-law has been acting like a prostitute, and now she is pregnant." "Bring her out!" Judah said. "Let her be burned [to death]!"
25. As she was being brought out, she sent her father-in-law [this message]: "I am pregnant by the man to whom these items belong." And she added, "Examine them. Whose signet ring, cord, and staff are these?"
26. Judah recognized [them] and said, "She is more in the right than I, since I did not give her to my son Shelah." And he did not know her intimately again.
27. When the time came for her to give birth, there were twins in her womb.
28. As she was giving birth, one of them put out his hand, and the midwife took it and tied a scarlet [thread] around it, announcing, "This one came out first."
29. But then he pulled his hand back, and his brother came out. Then she said, "You have broken out [first]!" So he was named Perez.
30. Then his brother, who had the scarlet [thread] tied to his hand, came out, and was named Zerah.