In the seventh aliyah Bilam then begins a prophecy about the coming of Moshiach and what he will do to the nations in the final days including the destruction of Amalak. After this, Bilam and Balak go home.
Following Bilam's unsuccessful attempt to curse the Jewish nation, Moavite young ladies come out and seduce Jewish men to be involved with Baal Peor, one of the Moavite gods. Rashi says that they did this on the advice of Bilam. G-d becomes angry and commands Moshe to hang the guilty people. Then, a Jewish man named Zimri publicly takes a Midianite woman to commit harlotry with her, and Pinchas, Aharon's grandson, takes a spear and kills them both in a miraculous way.