23 But the king of Ai they took alive, and brought him to Joshua. 24 And it came to pass when Israel had made an end of slaying all the inhabitants of Ai in the field, in the wilderness where they pursued them, and when they all had fallen by the edge of the sword until they were consumed, that all the Israelites returned to Ai and struck it with the edge of the sword. 25 So it was that all who fell that day, both men and women, were twelve thousand--all the people of Ai. 26 For Joshua did not draw back his hand, with which he stretched out the spear, until he had utterly destroyed all the inhabitants of Ai. 27 Only the livestock and the spoil of that city Israel took as booty for themselves, according to the word of the Lord which He had commanded Joshua. 28 So Joshua burned Ai and made it a heap forever, a desolation to this day. 29 And the king of Ai he hanged on a tree until evening. And as soon as the sun was down, Joshua commanded that they should take his corpse down from the tree, cast it at the entrance of the gate of the city, and raise over it a great heap of stones that remains to this day.
Matthew Henry's Commentary on Joshua 8:23-29
Commentary on Joshua 8:23-29
(Read Joshua 8:23-29)
God, the righteous Judge, had sentenced the Canaanites for their wickedness; the Israelites only executed his doom. None of their conduct can be drawn into an example for others. Especial reason no doubt there was for this severity to the king of Ai; it is likely he had been notoriously wicked and vile, and a blasphemer of the God of Israel.