The Torah commands in Parashat Shoftim (Debarim 18:20) that if somebody delivers a prophecy “in the name of other gods,” he must be put to death. This introduces the Biblical prohibition against falsely prophesying that an Aboda Zara (false deity) commanded that it be served a certain way, promising reward for those who perform the service, while warning that those who do not will be punished. This also includes a prohibition against falsely prophesying that G-d commanded worshipping a foreign deity.
One violates this prohibition even if he claims that the false god commanded doing something which the Torah considers a Misva. Although the action is itself virtuous, nevertheless, instructing people to perform the action in the name of a false deity transgresses this prohibition.
One who prophesies in the name of a false god is liable to capital punishment. This prohibition applies in all places and at all times, and is binding upon both men and women.
Two verses later (18:22), the Torah commands that in the case of a false prophet, “Lo Tagur Mimenu” – “Do not be afraid of him.” This introduces a Biblical command that forbids refraining from administering capital punishment to someone found guilty of falsely prophesying. The court might feel frightened because of the false prophet’s warnings of what might happen to those who disobey or oppose him, and so the Torah prohibits such fear, and requires administering capital punishment.
This Misva applies only in the times of the Bet Ha’mikdash, when the courts had the authority to administer capital punishment. The execution of a false prophet was conducted specifically by the seventy-one-member Sanhedrin.

