Balak, the king of Moab, summons the prophet Balaam to curse the people of Israel. On the way, Balaam is berated by his ass, who sees, before Balaam does, the angel that G‑d sends to block their way. Three times, from three different vantage points, Balaam attempts to pronounce his curses; each time, blessings issue forth instead. Balaam also prophesies on the end of the days and the coming of Moshiach.
The people fall prey to the charms of the daughters of Moab, and are enticed to worship the idol Peor. When a high-ranking Israelite official publicly takes a Midianite princess into a tent, Pinchas kills them both, stopping the plague raging among the people.