The conquest of Canaan is related in the Book of Joshua, which appears to have been written at the time of the Babylonian captivity. The thesis of political unity guaranteed by religious unity is supported, as in the Pentateuch, by a series of miracles. The miracle of the passage of the Red Sea is repeated at the passage of the Jordan. Joshua then besieges Jericho. “And it came to pass on the seventh day that they rose early at the dawning of the day, and compassed the city after the same manner seven times. And it came to pass at the seventh time, when the priests blew with the trumpets, Joshua said unto the people, Shout: for Jehovah hath given you the city. So the people shouted, and the wall fell down flat, so that the people went up into the city, every man straight before him, and they took the city. And they devoted all that was in the city, both man and woman, both young and old, and ox and sheep, and ass, with the edge of the sword.” Only Rahab, the harlot, who had betrayed her country by hiding the spies sent out by Joshua, was spared with her family and all her house. “And they burnt the city with fire, and all that was therein.” And Joshua pronounced a curse upon the man that should build it again.
The Israelites then besieged the city of Ai, near Bethel, and, having taken it by a stratagem, treated it as they had treated Jericho. “And all that fell that day, both of men and women, were twelve thousand.… So Joshua burnt Ai, and made it an heap for ever, even a desolation, unto this day. And the king of Ai he hanged on a tree until the eventide: and at the going down of the sun Joshua commanded, and they took his carcase from the tree, and cast it at the entering of the gate of the city, and raised thereon a great heap of stones, unto this day.” At the news of the destruction of Ai and Jericho, Adoni-zedek, king of Jerusalem, forms a coalition with the kings of Hebron, of Jarmuth, of Lachish, and of Eglon, and, hearing that Gibeon has treated with the enemy, they lay siege to the city which has betrayed their common cause. The Gibeonites call Joshua to their aid, and he departs from Gilgal with his army and comes up with the allied kings. “And Jehovah discomfited them before Israel, and he slew them with a great slaughter at Gibeon, and chased them by the way of the ascent of Beth-horon, and smote them unto Azekah and unto Makkedah. And it came to pass, as they fled from before Israel, while they were in the going down of Beth-horon, that Jehovah cast down great stones from heaven upon them unto Azekah, and they died: they were more which died with the hailstones than they whom the children of Israel slew with the sword. Then Joshua spake to Jehovah in the day when Jehovah delivered up the Amorites before the children of Israel; and he said in the sight of Israel, ‘Sun, stand thou still upon Gibeon; and thou, Moon, in the valley of Ajalon.’ And the sun stood still, and the moon stayed, until the nation had avenged themselves of their enemies. Is not this written in the book of the Upright? And the sun stayed in the midst of heaven, and hasted not to go down about a whole day. And there was no day like that before it or after it, that Jehovah hearkened to the voice of a man, for Jehovah fought for Israel.”