According to the Talmud, Judah's confession atoned for some of his prior faults, and itself resulted in him being divinely rewarded by a share in the future world (Sotah 7b) that he had used a prostitute. Tamar's sons by her father-in-law were the twins Pharez and Zerah, the fourth and fifth sons of Judah. Pharez in turn was an ancestor of David. (Genesis 38:1–30)