8 Then Adonai said to Joshua: “Do not be afraid or dismayed. Take all the people of war with you and arise, go up to Ai. Behold, I have given the king of Ai, his people, his city and his land into your hand. 2 Then you will do to Ai and its king as you did to Jericho and its king—except you will take its spoil and its cattle as booty for yourselves. Set an ambush for the city behind it.”
3 So Joshua and all the people of war arose to go up to Ai. Joshua selected 30,000 men, valiant warriors, and sent them at night. 4 He commanded them saying: “Look, you are going to ambush the city from behind it. Don’t go too far from the city, but all of you be ready. 5 Then I and all the troops with me will approach the city. Then it will be when they come out against us, like the first time, that we will flee before them. 6 So they will come out after us until we have drawn them away from the city. For they will think, ‘They are fleeing before us like the first time.’ While we are fleeing before them, 7 you will rise up from the ambush and take possession of the city, for Adonai your God will give it into your hand. 8 Now when you have seized the city, you will set the city on fire—according to the word of Adonai you must do. See that you do as I have ordered you.”
9 So Joshua sent them off, and they went to the ambush site, taking position between Bethel and Ai, to the west of Ai. But Joshua spent that night among the people. 10 Then Joshua rose up early in the morning and mustered the people. He and the elders of Israel marched before the people to Ai. 11 All the people of war with him went up, advanced, and came in front of the city. They camped to the north of Ai, with a valley between him and Ai. 12 But he had taken about 5,000 men and set them in ambush between Bethel and Ai, to the west of the city. 13 So they stationed the people, the main army that was to the north of the city, and its rear guard to the west of the city. Then Joshua walked that night in the midst of the valley.
14 So it came to pass when the king of Ai saw this, the men of the city hurried and rose up early, and went out to meet Israel in battle, he and all his people at the appointed place facing the Arabah. But he did not know that there was an ambush against him behind the city. 15 So Joshua and all Israel pretended to be beaten before them and fled by the way of the wilderness. 16 Then all the people who were in Ai were summoned to pursue them, so they pursued Joshua and were drawn away from the city. 17 Not a man was left in Ai or Bethel who did not go out after Israel, so they left the city open as they chased after Israel.
18 Then Adonai said to Joshua, “Stretch out the javelin that is in your hand toward Ai, for I will give it into your hand.” So Joshua stretched out the javelin that was in his hand toward the city. 19 As soon as he stretched out his hand, the ambush arose quickly from their place, ran and entered the city and captured it; and immediately set the city on fire. 20 Now the men of Ai looked back and saw, behold, the smoke of the city rising up to the sky! They had no place to flee this way or that, since the people who had been fleeing to the wilderness turned back upon the pursuers. 21 When Joshua and all Israel saw that the ambush had captured the city and that the smoke of the city rose up, they turned back and struck down the men of Ai. 22 The others also came out of the city against them, so they were surrounded by Israel, some on this side and some on that side. They struck them down until not one survivor or fugitive was left. 23 But they captured the king of Ai alive and brought him to Joshua.
24 After Israel had finished killing all the inhabitants of Ai in the field in the wilderness where they pursued them, and all of them were fallen by the edge of the sword until they were consumed, all Israel returned to Ai and struck it with the edge of the sword. 25 All who fell that day, both men and women, were 12,000—all the people of Ai. 26 For Joshua did not draw back his hand with which he stretched out the javelin, until he had utterly destroyed all the inhabitants of Ai. 27 Only the cattle and the spoil of that city Israel took as their booty, according to the word of Adonai which He had commanded Joshua. 28 So Joshua burnt Ai and made it a permanent heap of desolation to this day. 29 Then he hanged the king of Ai on a tree until evening. At sunset Joshua commanded that they take his carcass down from the tree, cast it at the entrance of the gate of the city, and piled over it a great heap of stones, which remains to this day.
30 Then Joshua built an altar to Adonai, God of Israel, on Mount Ebal, 31 as Moses the servant of Adonai had commanded Bnei-Yisrael, as written in the scroll of the Torah of Moses, an altar of uncut stones on which no man had wielded any iron tool. They offered on it burnt offerings to Adonai and sacrificed fellowship offerings. 32 There on the stones he wrote a copy of the Torah of Moses, which he had written, in the presence of Bnei-Yisrael. 33 Then all Israel, with their elders and officials, and their judges, were standing on both sides of the ark facing the Levitical kohanim carrying the ark of the covenant of Adonai—the outsider as well as the native-born. Half of them stood in front of Mount Gerizim and half of them in front of Mount Ebal—just as Moses the servant of Adonai had commanded before—in order to bless the people of Israel.
34 Then afterward he read all the words of the Torah—the blessing and the curse—according to all that is written in the book of the Torah. 35 There was not a word of all that Moses commanded that Joshua did not read before all the assembly of Israel, including the women and the little ones and the outsiders walking among them.