While Israel was staying in Acacia Grove, the people began to have sexual relations with the women of Moab.
The women invited them to the sacrifices for their gods, and the people ate and bowed in worship to their gods.
So Israel aligned itself with Baal of Peor, and the LORD's anger burned against Israel.
The LORD said to Moses, "Take all the leaders of the people and execute them in broad daylight before the LORD so that His burning anger may turn away from Israel."
So Moses told Israel's judges, "Kill each of the men who aligned themselves with Baal of Peor."
An Israelite man came bringing a Midianite woman to his relatives in the sight of Moses and the whole Israelite community while they were weeping at the entrance to the tent of meeting.
When Phinehas son of Eleazar, son of Aaron the priest, saw [this], he got up from the assembly, took a spear in his hand,
followed the Israelite man into the tent, and drove it through both the Israelite man and the woman-- through her belly. Then the plague on the Israelites was stopped,
but those who died in the plague numbered 24,000.
The LORD spoke to Moses,
"Phinehas son of Eleazar, son of Aaron the priest, has turned back My wrath from the Israelites because he was zealous among them with My zeal, so that I did not destroy the Israelites in My zeal.
Therefore declare: I grant him My covenant of peace.
It will be a covenant of perpetual priesthood for him and his descendants, because he was zealous for his God and made atonement for the Israelites."
The name of the slain Israelite man, who was struck dead with the Midianite woman, was Zimri son of Salu, the leader of a Simeonite ancestral house.
The name of the slain Midianite woman was Cozbi, the daughter of Zur, a tribal head of an ancestral house in Midian.
"Attack the Midianites and strike them dead.
For they attacked you with the treachery that they used against you in the Peor incident. They did the same in the case involving their sister Cozbi, daughter of the Midianite leader who was killed the day the plague came at Peor."
After the plague, the LORD said to Moses and Eleazar son of Aaron the priest,
"Take a census of the entire Israelite community by their ancestral houses of those 20 years old or more who can serve in Israel's army."
So Moses and Eleazar the priest said to them in the plains of Moab by the Jordan [across from] Jericho,
"[Take a census of] those 20 years old or more, as the LORD had commanded Moses and the Israelites who came out of the land of Egypt."
Reuben was the firstborn of Israel. Reuben's descendants: the Hanochite clan [from] Hanoch; the Palluite clan from Pallu;
the Hezronite clan from Hezron; the Carmite clan from Carmi.
These were the Reubenite clans, and their registered men numbered 43,730.
The son of Pallu was Eliab.
The sons of Eliab were Nemuel, Dathan, and Abiram. (It was Dathan and Abiram, chosen by the community, who fought against Moses and Aaron; they and Korah's followers fought against the LORD.
The earth opened its mouth and swallowed them with Korah, when his followers died and the fire consumed 250 men. They [serve as] a warning sign.
The sons of Korah, however, did not die.)
Simeon's descendants by their clans: the Nemuelite clan from Nemuel; the Jaminite clan from Jamin; the Jachinite clan from Jachin;
the Zerahite clan from Zerah; the Shaulite clan from Shaul.
These were the Simeonite clans, numbering 22,200 men.
Gad's descendants by their clans: the Zephonite clan from Zephon; the Haggite clan from Haggi; the Shunite clan from Shuni;
the Oznite clan from Ozni; the Erite clan from Eri;
the Arodite clan from Arod; the Arelite clan from Areli.
These were the Gadite clans [numbered] by their registered men: 40,500.
Judah's sons included Er and Onan, but they died in the land of Canaan.
Judah's descendants by their clans: the Shelanite clan from Shelah; the Perezite clan from Perez; the Zerahite clan from Zerah.
The descendants of Perez: the Hezronite clan from Hezron; the Hamulite clan from Hamul.
These were Judah's clans [numbered] by their registered men: 76,500.
Issachar's descendants by their clans: the Tolaite clan from Tola; the Punite clan from Puvah;
the Jashubite clan from Jashub; the Shimronite clan from Shimron.
These were Issachar's clans [numbered] by their registered men: 64,300.
Zebulun's descendants by their clans: the Seredite clan from Sered; the Elonite clan from Elon; the Jahleelite clan from Jahleel.
These were the Zebulunite clans [numbered] by their registered men: 60,500.
Joseph's descendants by their clans [from] Manasseh and Ephraim:
Manasseh's descendants: the Machirite clan from Machir. Machir fathered Gilead; the Gileadite clan from Gilead.
These were Gilead's descendants: the Iezerite clan [from] Iezer; the Helekite clan from Helek;
The Asrielite clan [from] Asriel; the Shechemite clan [from] Shechem;
the Shemidaite clan [from] Shemida; the Hepherite clan [from] Hepher;
Zelophehad son of Hepher had no sons-- only daughters. The names of Zelophehad's daughters were Mahlah, Noah, Hoglah, Milcah, and Tirzah.
These were Manasseh's clans, numbered by their registered men: 52,700.
These were Ephraim's descendants by their clans: the Shuthelahite clan from Shuthelah; the Becherite clan from Becher; the Tahanite clan from Tahan.
These were Shuthelah's descendants: the Eranite clan from Eran.
These were the Ephraimite clans [numbered] by their registered men: 32,500. These were Joseph's descendants by their clans.
Benjamin's descendants by their clans: the Belaite clan from Bela; the Ashbelite clan from Ashbel; the Ahiramite clan from Ahiram;
the Shuphamite clan from Shupham; the Huphamite clan from Hupham.
Bela's descendants [from] Ard and Naaman: the Ardite clan [from] Ard; the Naamite clan from Naaman.
These were the Benjaminite clans numbered by their registered men: 45,600.
These were Dan's descendants by their clans: the Shuhamite clan from Shuham. These were the clans of Dan by their clans.
All the Shuhamite clans [numbered] by their registered men were 64,400.
Asher's descendants by their clans: the Imnite clan from Imnah; the Ishvite clan from Ishvi; the Beriite clan from Beriah.
From Beriah's descendants: the Heberite clan from Heber; the Malchielite clan from Malchiel.
And the name of Asher's daughter was Serah.
These were the Asherite clans [numbered] by their registered men: 53,400.
Naphtali's descendants by their clans: the Jahzeelite clan from Jahzeel; the Gunite clan from Guni;
the Jezerite clan from Jezer; the Shillemite clan from Shillem.
These were the Naphtali clans numbered by their registered men: 45,400.
These registered Israelite men numbered 601,730.
The LORD spoke to Moses,
"The land is to be divided among them as an inheritance based on the number of names.
Increase the inheritance for a large [tribe], and decrease it for a small one. Each is to be given its inheritance according to those who were registered in it.
The land must be divided by lot; they will receive an inheritance according to the names of their ancestral tribes.
Each inheritance will be divided by lot among the larger and smaller [tribes]."
These were the Levites registered by their clans: the Gershonite clan from Gershon; the Kohathite clan from Kohath; the Merarite clan from Merari.
These were the Levite family groups: the Libnite clan, the Hebronite clan, the Mahlite clan, the Mushite clan, and the Korahite clan. Kohath was the ancestor of Amram.
The name of Amram's wife was Jochebed, a descendant of Levi, born to Levi in Egypt. She bore to Amram: Aaron, Moses, and their sister Miriam.
Nadab, Abihu, Eleazar, and Ithamar were born to Aaron,
but Nadab and Abihu died when they presented unauthorized fire before the LORD.
Those registered were 23,000, every male one month old or more; they were not registered among the [other] Israelites, because no inheritance was given to them among the Israelites.
These were the ones registered by Moses and Eleazar the priest when they registered the Israelites on the plains of Moab by the Jordan [across from] Jericho.
But among them there was not one of those who had been registered by Moses and Aaron the priest when they registered the Israelites in the Wilderness of Sinai.
For the LORD had said to them that they would all die in the wilderness. None of them was left except Caleb son of Jephunneh and Joshua son of Nun.
The daughters of Zelophehad approached; [Zelophehad was the] son of Hepher, son of Gilead, son of Machir, son of Manasseh from the clans of Manasseh, the son of Joseph. These were the names of his daughters: Mahlah, Noah, Hoglah, Milcah, and Tirzah.
They stood before Moses, Eleazar the priest, the leaders, and the entire community at the entrance to the tent of meeting and said,
"Our father died in the wilderness, but he was not among Korah's followers, who gathered together against the LORD. Instead, he died because of his own sin, and he had no sons.
Why should the name of our father be taken away from his clan? Since he had no son, give us property among our father's brothers."
Moses brought their case before the LORD,
and the LORD answered him,
"What Zelophehad's daughters say is correct. You are to give them hereditary property among their father's brothers and transfer their father's inheritance to them.
Tell the Israelites: When a man dies without having a son, transfer his inheritance to his daughter.
If he has no daughter, give his inheritance to his brothers.
If he has no brothers, give his inheritance to his father's brothers.
If his father has no brothers, give his inheritance to the nearest relative of his clan, and he will take possession of it. This is to be a statutory ordinance for the Israelites as the LORD commanded Moses."
Then the LORD said to Moses, "Go up this mountain of the Abarim [range] and see the land that I have given the Israelites.
After you have seen it, you will also be gathered to your people, as Aaron your brother was.
When the community quarreled in the Wilderness of Zin, both of you rebelled against My command to show My holiness in their sight at the waters." Those were the waters of Meribah of Kadesh in the Wilderness of Zin.
So Moses appealed to the LORD,
"May the LORD, the God of the spirits of all flesh, appoint a man over the community
who will go out before them and come back in before them, and who will bring them out and bring them in, so that the LORD's community won't be like sheep without a shepherd."
The LORD replied to Moses, "Take Joshua son of Nun, a man who has the Spirit in him, and lay your hands on him.
Have him stand before Eleazar the priest and the whole community, and commission him in their sight.
Confer some of your authority on him so that the entire Israelite community will obey [him].
He will stand before Eleazar who will consult the LORD for him with the decision of the Urim. He and all the Israelites with him, even the entire community, will go out and come back in at his command."
Moses did as the LORD commanded him. He took Joshua, had him stand before Eleazar the priest and the entire community,
laid his hands on him, and commissioned him, as the LORD had spoken through Moses.