Moshe directed the Israelites to appoint judges (שֹׁפְטִים) and officials for their tribes to govern the people with justice, with impartiality, and without bribes. "Justice, justice shalt thou follow," he said. Moshe warned the Israelites against setting up a sacred post beside God's altar. Moshe warned the Israelites against the sacrifice of an ox or sheep with any congenital severe disorder. Moshe instructed that if the Israelites found a person who worshiped other gods—the sun, the moon, or another astronomical object—they were to inquire thoroughly. If they established the fact on the testimony of two or more witnesses, then they were to stone the person to death, with the witnesses throwing the first stones. Moshe taught that if a legal case proved too baffling for the Israelites to decide, then they were promptly to go to the place where the sanctuary was located, appear before the kohanim or judge in charge, and present their problem, and carry out any verdict that was announced there without deviating either to the right or the left. They were to execute any man who presumptuously disregarded the priest or the judge so that all the people would hear, be afraid, and not act presumptuously again. Moshe instructed that if, after the Israelites had settled the Land of Israel, they decided to set a king over them, they would be free to take an Israelite chosen by God. The king was not to keep many horses, marry many wives, or amass excess silver and gold. The king was to write a copy of this Teaching to remain with him and read all his life so that he might learn to revere God and faithfully observe these laws. Moshe explained that the Levites were to have no territorial portion but live only on offerings, for God was to be their portion. In exchange for their service to God, the priests were to receive the shoulder, cheeks, and stomach of sacrifices, the first fruits of the Israelites, wine, oil, and the first sheep shearing. Moshe said that the country-based Levites were to be accessible to come from their settlements to the place God chose as a shrine to serve with their fellow Levites based there, and there, they were to receive equal shares of the dues. Moshe instructed that the Israelites were not to imitate the abhorrent practices of the nations that they were displacing, consign their children to fire, or act as an augur, soothsayer, diviner, sorcerer, who casts spells, one who consults ghosts or familiar spirits, or one who inquires of the dead, for it was because of those horrendous acts that God was dispossessing the residents of the land. Moshe foretold that God would raise a prophet from among them as if Moshe and the Israelites were to heed him. When at Mount Horeb, the Israelites had asked not to hear God's voice directly, God created the role of the prophet to speak God's words, promising to hold to account anybody who failed to heed the prophet's words. But any prophet who presumed to talk about an oracle in God's name that God had not commanded or who spoke in the name of other gods was to die. Moshe instructed that when the Israelites had settled in the land, they were to divide the land into three parts and set aside three Cities of Refuge so that any manslayer could have a place to flee. And if the Israelites faithfully observed all the laws and God enlarged the territory, they were to add three more towns to those three. Only a manslayer who had killed another unwittingly, without being the other's enemy, might flee there and live. Moshe warned that the Israelites were not to move their fellow citizens' landmarks, set up by previous generations, to the property they were allotted in the land.
Moshe instructed that an Israelite could be found guilty of an offense only on the testimony of two or more witnesses. If one person gave false testimony against another, the two parties were to appear before God and the priests or judges. The judges were to make a thorough investigation, and if they found the person to have testified falsely, they were to do to the witness as the witness schemed to do to the other. Moshe taught that before the Israelites joined battle, the priest was to tell the troops not to fear, for God would accompany them. Then the officials were to ask the troops whether anyone had built a new house but not dedicated it, planted a vineyard but never harvested it, paid the bride price for a wife but not yet married her, or become afraid and disheartened, and all these they were to send back to their homes. Moshe instructed that when the Israelites approached to attack a town, they were to offer it terms of peace, and if the city surrendered, then all the people of the town were to serve the Israelites as enslaved people. But if the town did not surrender, then the Israelites were to lay siege to the city, and when God granted victory, kill all its men and take as booty the women, children, livestock, and everything else in the town. Those were the rules for towns that lay very far from Israel. Still, for the cities of the nations in the land—the Hittites, Amorites, Canaanites, Perizzites, Hivites, and Jebusites—the Israelites were to kill everyone, lest they lead the Israelites into doing all the disgusting things that those nations had done for their gods. Moshe instructed that when the Israelites besieged a city for a long time, they could eat the fruit of the city's trees, but they were not to cut down any trees that could yield food. Moshe taught that if, in the land, they found the body of a murder victim lying in the open, and they could not determine the killer, then the elders and judges were to measure the distances from the corpse to the nearby towns. The elders of the nearest town were to take a heifer that had never worked down to an ever-flowing wadi and break its neck. The priests were to come forward; the elders were to declare that their hands did not shed the blood nor did their eyes see it, and they were to ask God to absolve the Israelites and not let guilt for the blood of the innocent remain among them, and God would absolve them of bloodguilt.