ADONAI said to Y'hoshua, "Don't be afraid or fall into despair! Take all the people who can fight with you, set out, and go up to 'Ai; because now I have handed over to you the king of 'Ai, his people, his city and his land.
Do to 'Ai and its king as you did to Yericho and its king; but this time, take its spoil and cattle as booty for yourselves. Ambush the city from behind."
So Y'hoshua set out for 'Ai with all the people who could fight. Y'hoshua chose 30,000 men, the most courageous of his troops, and sent them out by night.
He instructed them, "You are to lie in wait to ambush the city from behind. Stay close to the city; and all of you, be ready.
I and all the troops with me will approach the city; and when they come out to attack us, as they did before, we will run away from them.
They will chase after us until we have drawn them away from the city; because they will say, 'They're running away from us, as they did before'; so we'll run away from them.
Then you will jump up from your ambush position and take possession of the city, for ADONAI your God will hand it over to you.
When you have captured the city, you are to set it on fire; do according to what ADONAI has said. Those are your orders."
Y'hoshua sent them out; and they went to the place for the ambush, staying between Beit-El and 'Ai, to the west of 'Ai; while Y'hoshua camped that night with the people.
Y'hoshua got up early in the morning, mustered his men and went up to 'Ai ahead of the people, he and the leaders of Isra'el .
All the troops marching with him went up, advanced, arrived in front of the city and camped on the north side of 'Ai, with a valley between him and 'Ai.
Then he took about 5,000 men and set them in ambush between Beit-El and 'Ai, to the west of 'Ai.
Thus the people arrayed themselves, with all the army to the north of the city, and their rearguard lying in wait to the west of the city. Y'hoshua spent that night in the valley.
The king of 'Ai saw this, so the men in the city hurried out early in the morning to battle against Isra'el, he and all his people, at a meeting-place facing the 'Aravah. But he was unaware that behind the city an ambush had been laid against him.
Y'hoshua and all Isra'el made as if they had been defeated before them and ran off on the road to the desert.
All the people in 'Ai were summoned together to pursue them, so they chased Y'hoshua and were drawn away from the city.
Not a man was left in 'Ai or Beit-El who had not gone after Isra'el; pursuing Isra'el, they left the city wide open.
Then ADONAI said to Y'hoshua, "Point the spear in your hand toward 'Ai, because I will hand it over to you." Y'hoshua pointed the spear in his hand toward the city.
The men in ambush jumped up quickly from their place; the moment he stretched out his hand, they ran, entered the city and captured it; and they hurried to set the city on fire.
When the men of 'Ai looked behind them, they saw it - there was the smoke from the city, rising to the sky; and they had no power to flee this way or that - at which point the people who had run off toward the desert turned back on the pursuers.
When Y'hoshua and all Isra'el saw that the ambush had captured the city and that the smoke of the city was going up, they turned back and slaughtered the men of 'Ai;
while the others came out of the city against them too; so that they were surrounded by Isra'el with some on this side and some on that side. They attacked them, allowing none to remain or escape.
But they took the king of 'Ai alive and brought him to Y'hoshua.
When Isra'el had finished slaughtering all the inhabitants of 'Ai in the countryside, in the desert where they had pursued them, and they had all fallen, consumed by the sword, then all Isra'el returned to 'Ai and defeated it with the sword.
Twelve thousand men and women fell that day, everyone in 'Ai.
For Y'hoshua did not withdraw his hand, which he had used to point the spear, until he had utterly destroyed all the inhabitants of 'Ai.
Only the livestock and the spoil of that city did Isra'el take as booty for themselves, in keeping with the order ADONAI had given Y'hoshua.
So Y'hoshua burned down 'Ai and turned it into a tel forever, so that it remains a ruin to this day.
The king of 'Ai he hanged on a tree until evening; at sundown Y'hoshua gave an order, so they took his carcass down from the tree, threw it at the entrance of the city gate and piled on it a big heap of stones, which is there to this day.
Then Y'hoshua built an altar to ADONAI, the God of Isra'el, on Mount 'Eival,
as Moshe the servant of ADONAI had ordered the people of Isra'el to do (this is written in the book of the Torah of Moshe), an altar of uncut stones that no one had touched with an iron tool. On it they offered burnt offerings to ADONAI and sacrificed peace offerings.
He wrote there on the stones a copy of the Torah of Moshe, inscribing it in the presence of the people of Isra'el.
Then all Isra'el, including their leaders, officials and judges, stood on either side of the ark in front of the cohanim, who were L'vi'im and who carried the ark for the covenant of ADONAI. The foreigners were there along with the citizens. Half of the people were in front of Mount G'rizim and half of them in front of Mount 'Eival, as Moshe the servant of ADONAI had ordered them earlier in connection with blessing the people of Isra'el.
After this, he read all the words of the Torah, the blessing and the curse, according to everything written in the book of the Torah.
There was not a word of everything Moshe had ordered that Y'hoshua did not read before all Isra'el assembled, including the women, the little ones and the foreigners living with them.