Genesis 38:7-10

JPS_ASV_Byz(i) 7 And Er, Judah's first-born, was wicked in the sight of the LORD; and the LORD slew him. 8 And Judah said unto Onan: 'Go in unto thy brother's wife, and perform the duty of a husband's brother unto her, and raise up seed to thy brother.' 9 And Onan knew that the seed would not be his; and it came to pass when he went in unto his brother's wife, that he spilled it on the ground, lest he should give seed to his brother. 10 And the thing which he did was evil in the sight of the LORD; and He slew him also.