Balak, king of Moab, fears the approach of the Israelites. Together with the elders of Midian, he attempts to hire the well-known Mesopotamian prophet Balaam to curse them. Balaam consults with God, who tells him not to go, but the Moabites and Midianites return with another offer. This time God instructs Balaam to accompany them but only to say the words He puts in his mouth. After a strange episode in which Balaam’s donkey sees an angel blocking the way, Balaam and Balak ascend a mountain overlooking the Israelites’ camp.
Three times at different places they prepare altars and sacrifices, but each time, Balaam utters blessings instead of curses. Balak leaves in anger and frustration. Having been spared Balaam’s curses, however, the Israelites bring disaster on themselves through adultery and idolatry, seduced by the local women. Twenty-four thousand people die in a plague that strikes the camp until Pinhas, in an act of zealotry, rises up against one of the wrongdoers.