1 About that time Judah left his brothers and went down to stay with a man of Adullam named Hirah.
2 There Judah saw the daughter of a Canaanite man named Shua. He married her and slept with her,
3 and she conceived and gave birth to a son, whom he named Er.
4 She conceived once more and gave birth to a son, and she named him Onan.
5 She had yet another son and named him Shelah; it was at Chezib that she gave birth to him.
6 Judah got a wife for his firstborn Er; her name was Tamar.
7 But Er, Judah's firstborn, was wicked in the LORD's sight, so the LORD took his life.
8 Then Judah told Onan, "Sleep with your brother's wife and fulfill your duty to her as brother-in-law, so as to raise up offspring for your brother."
9 Onan knew, however, that the offspring would not count as his. So whenever he slept with his brother's wife, he let the semen spill on the ground to avoid providing offspring for his brother.
10 What he did was evil in the sight of the LORD, and the LORD took his life too.
11 Then Judah said to his daughter-in-law Tamar, "Live as a widow in your father's house until my son Shelah is grown." For he thought, "He too might die, like his brothers." So Tamar went to live in her father's house.
12 A long time afterward, Judah's wife, the daughter of Shua, died. After Judah had been consoled, he went up to Timnah to his sheepshearers, he and his friend Hirah the Adullamite.
13 Tamar was told, "Your father-in-law is on his way up to Timnah to shear his sheep."
14 So she took off her widow's clothes, covered herself with a veil, wrapped herself up, and sat down at the entrance to Enaim, on the road to Timnah. For she saw that Shelah was now grown up, yet she had not been given to him as his wife.
15 When Judah saw her, he took her for a prostitute, since she had her face covered.
16 He turned off the road toward her and said, "Come now, let me sleep with you," not knowing she was his daughter-in-law. She asked, "What will you give me for sleeping with me?"
17 "I will send you a young goat from the flock," he answered. She said, "Only if you give me something as a pledge until you send it."
18 He asked, "What pledge should I give you?" She replied, "Your seal and cord, and the staff in your hand." He gave them to her and slept with her, and she became pregnant by him.
19 She got up and left, removed her veil, and put her widow's clothes back on.
20 Judah sent the young goat by his friend the Adullamite to get back the pledge from the woman, but he could not find her.
21 He asked the men who lived there, "Where is the cult prostitute who was beside the road at Enaim?" They said, "There has been no cult prostitute here."
22 So he went back to Judah and said, "I could not find her. Besides, the men who live there said, 'There has been no cult prostitute here.'"
23 Judah said, "Let her keep what she has, or we will become a laughingstock. I did send this young goat, after all, and you could not find her."
24 Some three months later Judah was told, "Your daughter-in-law Tamar has acted as a prostitute, and what is more, she is pregnant as a result." Judah said, "Bring her out and have her burned!"
25 As she was being brought out, she sent a message to her father-in-law: "I am pregnant by the man who owns these." And she added, "Please take a close look: whose seal and cord and staff are these?"
26 Judah recognized them and said, "She is more in the right than I am, since I did not give her to my son Shelah." And he did not sleep with her again.
27 When the time came for her to give birth, there were twins in her womb.
28 During the delivery one of them put out a hand, and the midwife took a scarlet thread and tied it on his hand, saying, "This one came out first."
29 But he drew his hand back, and then his brother came out. She said, "So you have broken out for yourself!" That is why he was named Perez.
30 After that his brother came out, with the scarlet thread on his hand, and he was named Zerah.