5:1 As soon as all the kings of the Amorites who were beyond the Jordan to the west, and all the kings of the Canaanites who were by the sea, heard that the Lord had dried up the waters of the Jordan for the people of Israel until they had crossed over, their hearts melted and there was no longer any spirit in them because of the people of Israel.
2 At that time the Lord said to Joshua, “Make flint knives and circumcise the sons of Israel a second time.” 3 So Joshua made flint knives and circumcised the sons of Israel at Gibeath-haaraloth. 4 And this is the reason why Joshua circumcised them: all the males of the people who came out of Egypt, all the men of war, had died in the wilderness on the way after they had come out of Egypt. 5 Though all the people who came out had been circumcised, yet all the people who were born on the way in the wilderness after they had come out of Egypt had not been circumcised. 6 For the people of Israel walked forty years in the wilderness, until all the nation, the men of war who came out of Egypt, perished, because they did not obey the voice of the Lord; the Lord swore to them that he would not let them see the land that the Lord had sworn to their fathers to give to us, a land flowing with milk and honey. 7 So it was their children, whom he raised up in their place, that Joshua circumcised. For they were uncircumcised, because they had not been circumcised on the way.
8 When the circumcising of the whole nation was finished, they remained in their places in the camp until they were healed. 9 And the Lord said to Joshua, “Today I have rolled away the reproach of Egypt from you.” And so the name of that place is called Gilgal to this day.
10 While the people of Israel were encamped at Gilgal, they kept the Passover on the fourteenth day of the month in the evening on the plains of Jericho. 11 And the day after the Passover, on that very day, they ate of the produce of the land, unleavened cakes and parched grain. 12 And the manna ceased the day after they ate of the produce of the land. And there was no longer manna for the people of Israel, but they ate of the fruit of the land of Canaan that year.
13 When Joshua was by Jericho, he lifted up his eyes and looked, and behold, a man was standing before him with his drawn sword in his hand. And Joshua went to him and said to him, “Are you for us, or for our adversaries?” 14 And he said, “No; but I am the commander of the army of the Lord. Now I have come.” And Joshua fell on his face to the earth and worshiped and said to him, “What does my lord say to his servant?” 15 And the commander of the Lord’s army said to Joshua, “Take off your sandals from your feet, for the place where you are standing is holy.” And Joshua did so. (ESV)