ONANISM, term derived from the biblical narrative of Onan, son of Judah (Gen. 38, 7–10), who "spilled" his seed "on the ground." Onanism refers to the thwarting of the sexual process in one of several ways. In Hebrew, it is called more fully ma'aseh Er ve-Onan ("the act of Er and Onan") and is taken by the Midrash (Gen. R. 85:5; and by Rashi to the Pentateuch) to mean coitus interruptus and by the Talmud (Yev. 34b) to refer either to unnatural intercourse or (cf. Nid. 13a) to masturbation. The Zohar (Va-Yeshev, p. 188a; Va-Yeḥi, p. 219b) expatiates on the evil of onanism in the last sense, which condemnation then entered the Shulhan Arukh (EH, 23:2) to underscore the gravity of the sin of hashḥatat zera ("improper emission of seed"). Halakhically, there is a question whether the prohibition against onanism, in any sense, is a prohibition of biblical or of rabbinic force. A 16th-century legal work by R. Moses Trani, Kiryat Sefer (on Yad, Issurei Bi'ah, 21), whose express purpose is to determine which of the commandments are biblical and which rabbinic, did not reach a decision about onanism. The Onan narrative in the Bible is pre-Sinai, and the context makes it sufficiently doubtful whether Onan's sin is his contraceptive act or his frustration of the purpose of levirate marriage, i.e., to establish progeny for his brother. Other biblical bases for onanism or hashḥatat zera (Gen. 1:28; 6:12; Ex. 20:13; Lev. 18:6; Isa. 1:15; 57:5) are variously regarded as deductive, or "intimations" (remez), from the standpoint of their biblical derivation, though the prohibition is nonetheless clear. The question is of more than academic interest, as evidenced by the circumstances under which onanism is condoned. Coitus interruptus, for example, is actually recommended by R. Eliezer in the Talmud (Yev. 34b) as a contraceptive procedure to prevent dilution of the mother's milk during nursing, but is rejected by the other sages and is forbidden by all the law codes, beginning with that of Maimonides (Yad, Issurei Bi'ah 21:18). Yet the factors of intent and constancy (as was indeed the case with Onan) are considered, and the responsa would permit, for example, the continuance of marital relations where interrupted coitus is unintentional or irregular. On the other hand, the deviations of "unnatural" coitus (she-lo kedarkah) are objected to on moral grounds (Maim. Comm. to Sanh. 7:4), though legally permitted (Ned. 20b; Sanh. 58b). R. Isaac in tosafot (Yev. 34b) reconciled the leniency of the sages in law with what they condemned in Er and Onan, by distinguishing between the corrupt intent of Onan and legitimate heterosexual intent in ordinary marital relations. The responsa, too, ruled in accordance with the latter interpretation – despite the reaction that set in against this point of view after the Zohar appeared, leading R. Joseph Caro to claim that R. Isaac would not have ruled so permissively had he seen what the Zohar says on the subject (Bedek ha-Bayit to Beit Yosef, EH, 25). Other medieval mystical works sided with the Zohar in this matter, but the legal tradition affirmed the permissibility of she-lo kedarkah in marital relations. A post-medieval mystic, R. Jacob Emden (d. 1776), addressed himself to the difference between the talmudic and zoharic attitudes toward onanism in the sense of masturbation, which has consequences for the question of birth control. He prefers the attitude of the Talmud, and calls that of the Zohar "exaggeration" (Mitpaḥat Sefarim (Altona, 1768), 1:20). More important, he emphasizes a doctrine, articulated by earlier legal authorities, that the prohibition against onanism in method is not applicable to marital contraception; that when contraception is necessary and abstinence would be the alternative, then possible onanism in the use of a contraceptive device is neutralized by the positive mitzvah of marital sex. In the voluminous responsa literature on birth control, the dominant tendency is to rule in this manner; namely, that Onan's marriage to his brother's widow, ordinarily prohibited, was exceptionally permitted in order to produce progeny – a purpose his act frustrated. But in ordinary marriages, the sexual relation without procreative possibility is allowable; and, where contraception must be practiced, the use of a device which smacks of Onan's method but is free of his intent (Tosefot Ri-D to Yev. 12b) is preferable to abstinence, so that the mitzvah of marital sex can be continued. For reasons such as this, an oral contraceptive – such as the pill, or its talmudic prototype, the kos shel ikkarin ("cup of barrenness") – is preferable to other contraceptive devices, for an oral contraceptive is onanistic neither in intent nor in method. Because of the objectionable methods of contraception available, rabbinic responsa by and large allowed contraception only for medical reasons. However, where oral contraception is possible, the responsa would be more permissive – but only in a way consistent with the overriding mitzvah of procreation.