2,145. A Zealot
Hilchos Issurei Biah 12:4
Let’s say that a Jewish man has sexual relations with a non-Jewish woman in the presence of ten or more other Jews. If a zealous person strikes him down, it is considered praiseworthy, whether the relations occurred in the context of marriage or were promiscuous. This is a law communicated to Moshe at Sinai, supported by the story of Pinchas killing Zimri in Numbers chapter 25. [Editor’s note: we strongly recommend that you NOT do this as a matter of practical halacha.]
Hilchos Issurei Biah 12:5
The zealous person may only strike the offenders while the relations are going on, as Pinchas did with regard to Zimri. (See Numbers 25:8.) If the offender ceases, he may not be struck down. Rather, if the zealot kills him, the zealot is executed for murder. If the zealot goes to ask permission from the court, they don’t advise him to kill the offender even if the relations are still ongoing. Further, if the zealot goes to kill the offender and the offender ceases and then kills the zealot in self-defense, the offender is not liable for killing the zealot. If a Jewish man has sexual relations with the daughter of a ger toshav (a “resident alien” who observes the Noachide laws), a zealot is not permitted to strike him down, though the offender is given stripes for acting rebelliously.