This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages)(Learn how and when to remove this template message)
The heresy of Peor is an event related in the Torah at Numbers 25:1–15. Later biblical references to the event occur in Numbers 25:18 and 31:16, Deuteronomy 4:3, Joshua 22:17, Hosea 9:10; Psalm 106:28. Another reference is found in the New Testament, 1 Corinthians 10:8 and Revelation 2:14.
The story proceeds from that of the prophet Balaam, in which he ascends the mountain of Pe‘or, and makes sacrifices to God from atop it. Having finished his sacrifices, Balaam views the Israelites on the plain below, and although hired to curse them, pronounces a blessing over them, prophesying their blessed nature and destruction of Moab and the other adversaries of Israel. When the narrative focus returns to the point of view of the Israelites, the contrast between Balaam's voiced opinion of them, and their actual behaviour, is distinctly noticeable.
According to the Torah, the Israelites, after spending a short time in the plain of Moab, begin to involve themselves with the Moabite women. Consequently, under the influence of Moabite culture, the Israelites begin participating in the worship of the Moabite gods, and join themselves to Baal Peor (Hebrew בעל פעור Ba‘al Pə‘ôr), in the Septuagint Beelphegōr, a baal associated with Mount Pe‘or.
Yahweh orders Moses to gather the chiefs of the people and hang up the idolaters before Yahweh to turn away Yahweh's anger. The scene then abruptly shifts from concerns about Moabites to those about Midianites. A man — Israelite Zimri, the son of Salu — brings a Midianite woman Cozbi into the camp in the sight of Moses, where the people are weeping. Phinehas, grandson of Aaron, thereupon rises up with a spear, follows the man into a tent and thrusts the spear through both the man and woman, who were evidently in the act of copulation. The plague, from which 24,000 had died, then ceased to take life. A war with Midian follows later.
Revelation 2:14 implies that after Balaam had blessed Israel, he later went back and influenced Balak to corrupt Israel through seducing them with women into idolatry: "But I have a few things against thee, because thou hast there them that hold the doctrine of Balaam, who taught Balac to cast a stumblingblock before the children of Israel, to eat things sacrificed unto idols, and to commit fornication" (King James Version).[original research?]
If Pe‘or is connected to the Hebrew stem p‘r 'open', used both of mouth and bowels, it might mean 'opening' and so Ba‘al Pe‘or could mean 'Lord of the Opening'. This apparent meaning is probably the source of Talmudic traditions associating Ba‘al Pe‘or with exposure and excrement. The tractate Sanhedrin 64a attributes to Rab through Rabbi Judah the story of a sick Gentile woman who vowed to worship every idol in the world if she recovered. Upon recovery she set out to fulfill her vow, but drew back at Pe‘or as the rites disgusted her: eating beets, drinking strong drink, and then uncovering oneself.
A story follows about a Jew who showed his contempt for the god by wiping his behind on its nose after defecating in the temple and who was praised for his piety by the acolytes of the god who said: no man has ever before served this idol thus. Tractate ‘Avodah Zarah 3 states in the Gemara that the area before the idol Pe‘or was used as a latrine and that the worship of the idol consisted of defecating before it. Rashi comments on Numbers 25.3 that Pe‘or was so called because they would uncover before it the end of the rectum and bring forth excrement; this is its worship.
From Moab to Midian
The abrupt change from concerns about the Moabites to the Midianites, and mention of the end of a plague which is never described as starting, is explained by the documentary hypothesis as being due to a change from the JE source to the Priestly source. Despite the Torah redactor usually, according to the hypothesis, interlacing together the sources, the stories here were evidently difficult to combine, as the redactor appears to have cut the end from the JE version, and the beginning from the Priestly version, and joined the resulting texts together.
As the Priestly source is considered to be based on the JE source, albeit spun to the Aaronid priesthood's political viewpoint, the original JE ending, and priestly source beginning, can be expected to be fairly similar to the text that is currently present. Nevertheless, the use of plagues, by God, to punish the people in very large numbers, is unique to the Priestly source, once the Israelites have left Egypt, and consequently this detail is unlikely to have been present in the original.
While it is considered uncertain as to why the Priestly source would change Moab to Midian, it is generally agreed amongst critical scholars that the account of the war against Midian, and its spoils, originates from a writer who added these elements to the original version of the Priestly source. The command to vex the Midianites is also considered a part of these additions, and thus the revenge on Midian serves as a vehicle for this writer to include the list of spoils, and its distribution, which has a larger amount of text than the narrative of the war. Thus, this later writer could easily have changed Moab to Midian to facilitate this addition.