But these five kings had fled and hidden themselves in a cave at Makkedah.
And it was told Joshua, saying, "The five kings have been found hidden in the cave at Makkedah."
So Joshua said, "Roll large stones against the mouth of the cave, and set men by it to guard them.
And do not stay there yourselves, but pursue your enemies, and attack their rear guard. Do not allow them to enter their cities, for the Lord your God has delivered them into your hand."
Then it happened, while Joshua and the children of Israel made an end of slaying them with a very great slaughter, till they had finished, that those who escaped entered fortified cities.
And all the people returned to the camp, to Joshua at Makkedah, in peace. No one moved his tongue against any of the children of Israel.
Then Joshua said, "Open the mouth of the cave, and bring out those five kings to me from the cave."
And they did so, and brought out those five kings to him from the cave: the king of Jerusalem, the king of Hebron, the king of Jarmuth, the king of Lachish, and the king of Eglon.
So it was, when they brought out those kings to Joshua, that Joshua called for all the men of Israel, and said to the captains of the men of war who went with him, "Come near, put your feet on the necks of these kings." And they drew near and put their feet on their necks.
Then Joshua said to them, "Do not be afraid, nor be dismayed; be strong and of good courage, for thus the Lord will do to all your enemies against whom you fight."
And afterward Joshua struck them and killed them, and hanged them on five trees; and they were hanging on the trees until evening.
So it was at the time of the going down of the sun that Joshua commanded, and they took them down from the trees, cast them into the cave where they had been hidden, and laid large stones against the cave's mouth, which remain until this very day.
On that day Joshua took Makkedah, and struck it and its king with the edge of the sword. He utterly destroyed them--all the people who were in it. He let none remain. He also did to the king of Makkedah as he had done to the king of Jericho.
Then Joshua passed from Makkedah, and all Israel with him, to Libnah; and they fought against Libnah.
And the Lord also delivered it and its king into the hand of Israel; he struck it and all the people who were in it with the edge of the sword. He let none remain in it, but did to its king as he had done to the king of Jericho.
Then Joshua passed from Libnah, and all Israel with him, to Lachish; and they encamped against it and fought against it.
And the Lord delivered Lachish into the hand of Israel, who took it on the second day, and struck it and all the people who were in it with the edge of the sword, according to all that he had done to Libnah.
Then Horam king of Gezer came up to help Lachish; and Joshua struck him and his people, until he left him none remaining.
From Lachish Joshua passed to Eglon, and all Israel with him; and they encamped against it and fought against it.
They took it on that day and struck it with the edge of the sword; all the people who were in it he utterly destroyed that day, according to all that he had done to Lachish.
So Joshua went up from Eglon, and all Israel with him, to Hebron; and they fought against it.
And they took it and struck it with the edge of the sword--its king, all its cities, and all the people who were in it; he left none remaining, according to all that he had done to Eglon, but utterly destroyed it and all the people who were in it.
Then Joshua returned, and all Israel with him, to Debir; and they fought against it.
And he took it and its king and all its cities; they struck them with the edge of the sword and utterly destroyed all the people who were in it. He left none remaining; as he had done to Hebron, so he did to Debir and its king, as he had done also to Libnah and its king.
So Joshua conquered all the land: the mountain country and the South and the lowland and the wilderness slopes, and all their kings; he left none remaining, but utterly destroyed all that breathed, as the Lord God of Israel had commanded.
References for Joshua 10:40
And Joshua conquered them from Kadesh Barnea as far as Gaza, and all the country of Goshen, even as far as Gibeon.
All these kings and their land Joshua took at one time, because the Lord God of Israel fought for Israel.
Then Joshua returned, and all Israel with him, to the camp at Gilgal.