When Onan had sex with Tamar, he withdrew before he ejaculated and "spilled his seed on the ground" thus committing coitus interuptus, since any child born would not legally be considered his heir. The next statement in the Bible says that Onan displeased Yahweh, so the Lord slew him.