As she was giving birth, one of them put out his hand; the midwife took it and tied a scarlet thread around it, saying, “This one came out first.”
In context
26Judah recognized them and said, “She is more righteous than I am, since I did not give her to my son Shelah.” And he did not sleep with her again. 27When the time came for her to give birth, there were twins in her womb. 28As she was giving birth, one of them put out his hand; the midwife took it and tied a scarlet thread around it, saying, “This one came out first.” 29But then he pulled his hand back, and there came out his brother. “So this is how you break out!” she said. So he was named Perez. 30Then his brother came out, with the scarlet thread on his hand, and he was named Zerah.