About that time Judah left his brothers and camped near a certain Adullamite whose name was Hirah. There Judah saw the daughter of a certain Canaanite whose name was Shua, and he married her and cohabited with her. She conceived and bore a son, and he named him Er. She conceived again and bore a, son, and named him Onan. Once again she bore a son, and named him Shelah; he was at Chezib when she bore him.
Judah got a wife for Er his first-born; her name was Tamar. But Er, Judah's first-born, was displeasing to the LORD, and the LORD took his life. Then Judah said to Onan, "Join with your brother's wife and do your duty by her as a brother-in-law, and provide offspring for your brother." But Onan, knowing that the seed would not count as his, let it go to waste whenever he joined with his brother's wife, so as not to provide offspring for his brother. What he did was displeasing to the LORD, and He took his life also. Then Judah said to his daughter-in-law Tamar, "Stay as 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 to live in her father's house.
A long time afterward, Shua's daughter, the wife of Judah, died. When his period of mourning was over, Judah went up to Timnah to his sheepshearers, together with his friend Hirah the Adullamite. And Tamar was told, "Your father-in-law is coming up to Timnah for the sheepshearing." So she took off her widows garb, covered her face with a veil, and, wrapping herself up, sat down at the entrance to Enaim, which is on the road to Timnah; for she saw that Shelah was grown up, yet she had not been given to him as wife. When Judah saw her, he took her for a harlot; for she had covered her face. So he turned aside to her by the road and said, "Here, let me sleep with you"--for he did not know that she was his daughter-in-law. "What," she asked, "will you pay for sleeping with me?" He replied, "I will send a kid from my flock." But she said, "You must leave a pledge until you have sent it." And he said, 'What pledge shall I give you?" She replied, "Your seal and cord, and the staff which you carry." So he gave them to her and slept with her, and she conceived by him. Then she went on her way. She took off her veil and again put on her widow's garb.
Judah sent the kid by his friend the Adullamite, to, redeem the pledge from the woman; but he could not find her. He inquired of the people of that town, "Where is the cult prostitute, the one at Enaim, by the road?" But they said, "There has been no prostitute here." So he returned to Judah and said, "I could not find her; moreover, the townspeople said: There has been no prostitute here." Judah said, "Let her keep them, lest we become a laughingstock. I did send her this kid, but you did not find her."
About three months later, Judah was told, "Your daughter-in-law Tamar has played the harlot; in fact, she is with child by harlotry." "Bring her out," said Judah, "and let her be burned." As she was being brought out, she sent this message to her father-in-law, "I am with child by the man to whom these belong." And she added, "Examine these: whose seal and cord and staff are these?" Judah recognized them, and said, "She is more in the right than I, inasmuch as I did not give her to my son Shelah." And he was not intimate with her again. When the time came for her to give birth, there were twins in her womb! While she was in labor, one of them put out, his hand, and the midwife tied a crimson thread on that hand, to signify: This one came out first. But just then he drew back his hand, and out came his brother; and she said, "What a breach you have made for yourself!" So he was named Perez. Afterward his brother came out, on whose hand was the crimson thread; he was named Zerah.