Tamar (Hebrew: תָּמָר) was the wife and widow of Er and then Onan and the mother of Judah's fourth and fifth sons Perez and Zerah.
Judah arranged a marriage between Tamar and his firstborn son Er. Er, however, was wicked, and God killed him in judgment.
Judah then had his second son Onan marry Tamar in accordance with custom. However, Onan knew that any offspring of his with Tamar would legally be considered offspring of the deceased Er; thus, if he and Tamar were to have children, they would displace him in the line of succession per primogeniture. In order to prevent Tamar from conceiving children, Oran would pull out and ejaculated onto the ground instead of into Tamar's womb. This displeased God, and God killed Onan in judgment as well.
Judah then promised Tamar his third and sole remaining son in marriage once he matured enough. Judah feared losing his sole renaming son to the same fate as his deceased brothers, so he procrastinated.
One day, Judah's wife died, and Judah mourned. Once the period of mourning ending, Judah announced that he was traveling to shear his sheep.
Tamar realized that Judah was not going to allow her to marry his sole remaining son, so she took action in order to finally become a mother. She disguised herself as a prostitute, and Judah took the bait. Judah sought her services and offered her a goat as payment. Tamar demanded to hold onto Judah's ring, cord, and staff as a security deposit, and Judah agreed. Tamar and Judah had intercourse, and they conceived a child. Tamar then left.
Judah attempted to find the woman again in order to give her the promised goat and recover his security deposit, but he could not find her.
Three months later, Tamar was discovered to be pregnant. Judah assumed that she committed an act of adultery and harlotry whilst still engaged to his son and called for her to be burned.
Tamar showed Judah the ring, cord, and staff that he was given to her as a security deposit and realized that she was the one he had intercourse with. Judah ordered his men to free her since he had been more unfair to her (for breaking his promise to allow her to marry his son) than she had been to him.
Tamar gave birth to twin sons: Perez and Zerah.
Judah did not have any further sexual relations with Tamar.