81The LORD said to Joshua, “Take all the soldiers with you and go on up to Ai. Don't be afraid or discouraged. I will give you victory over the king of Ai; his people, city, and land will be yours. 2You are to do to Ai and its king what you did to Jericho and its king, but this time you may keep its goods and livestock for yourselves. Prepare to attack the city by surprise from the rear.”
3So Joshua got ready to go to Ai with all his soldiers. He picked out 30,000 of his best troops and sent them out at night 4with these orders: “Hide on the other side of the city, but not too far away from it; be ready to attack. 5My men and I will approach the city. When the men of Ai come out against us, we will turn and run, just as we did the first time. 6They will pursue us until we have led them away from the city. They will think that we are running away from them, as we did before. 7Then you will come out of hiding and capture the city. The LORD your God will give it to you. 8After you have taken the city, set it on fire, just as the LORD has commanded. These are your orders.” 9So Joshua sent them out, and they went to their hiding place and waited there, west of Ai, between Ai and Bethel. Joshua spent the night in camp.
10Early in the morning Joshua got up and called the soldiers together. Then he and the leaders of Israel led them to Ai. 11The soldiers with him went towards the main entrance to the city and set up camp on the north side, with a valley between themselves and Ai. 12He took about 5,000 men and put them in hiding west of the city, between Ai and Bethel. 13The soldiers were arranged for battle with the main camp north of the city and the rest of the men to the west. Joshua spent the night in the valley. 14When the king of Ai saw Joshua's men, he acted quickly. He and all his men went out towards the Jordan Valley to fight the Israelites at the same place as before, not knowing that he was about to be attacked from the rear. 15Joshua and his men pretended that they were retreating, and ran away towards the barren country. 16All the men in the city had been called together to go after them, and as they pursued Joshua, they kept getting farther away from the city. 17Every man in Ai8.17 One ancient translation Ai; Hebrew Ai and Bethel. went after the Israelites, and the city was left wide open, with no one to defend it.
18Then the LORD said to Joshua, “Point your spear at Ai; I am giving it to you.” Joshua did as he was told, 19and as soon as he lifted his hand, the men who had been hiding got up quickly, ran into the city and captured it. They immediately set the city on fire. 20When the men of Ai looked back, they saw the smoke rising to the sky. There was no way for them to escape, because the Israelites who had run towards the barren country now turned round to attack them. 21When Joshua and his men saw that the others had taken the city and that it was on fire, they turned round and began killing the men of Ai. 22The Israelites in the city now came down to join the battle. So the men of Ai found themselves completely surrounded by Israelites, and they were all killed. No one got away, and no one lived through it 23except the king of Ai. He was captured and taken to Joshua.
24The Israelites killed every one of the enemy in the barren country where they had chased them. Then they went back to Ai and killed everyone there. 25-26Joshua kept his spear pointed at Ai and did not put it down until every person there had been killed. The whole population of Ai was killed that day — 12,000 men and women. 27The Israelites kept for themselves the livestock and goods captured in the city, as the LORD had told Joshua. 28Joshua burnt Ai and left it in ruins. It is still like that today. 29He hanged the king of Ai from a tree and left his body there until evening. At sunset Joshua gave orders for the body to be removed, and it was thrown down at the entrance to the city gate. They covered it with a huge pile of stones, which is still there today.
Then Joshua built on Mount Ebal an altar to the LORD, the God of Israel. 31
He made it according to the instructions that Moses, the LORD's servant, had given the Israelites, as it says in the Law of Moses: “an altar made of stones which have not been cut with iron tools.” On it they offered burnt sacrifices to the LORD, and they also presented their fellowship offerings. 32There, with the Israelites looking on, Joshua made on the stones8.32 the stones; or stones. a copy of the Law which Moses had written. 33
The Israelites, with their leaders, officers, and judges, as well as the foreigners among them, stood on two sides of the LORD's Covenant Box, facing the levitical priests who carried it. Half the people stood with their backs to Mount Gerizim and the other half with their backs to Mount Ebal. The LORD's servant Moses had commanded them to do this when the time came for them to receive the blessing. 34Joshua then read aloud the whole Law, including the blessings and the curses, just as they are written in the book of the Law. 35Every one of the commandments of Moses was read by Joshua to the whole gathering, which included women and children, as well as the foreigners living among them.