Now when Joshua was near Jericho, he looked up and saw a man standing in front of him with a drawn sword in his hand. Joshua went up to him and asked, “Are you for us or for our enemies?”
“Neither,” he replied, “but as commander of the army of the Lord I have now come.” Then Joshua fell facedown to the ground in reverence, and asked him, “What message does my Lord have for his servant?”
The commander of the Lord’s army replied, “Take off your sandals, for the place where you are standing is holy.” And Joshua did so.
Now the gates of Jericho were securely barred because of the Israelites. No one went out and no one came in.
Then the Lord said to Joshua, “See, I have delivered Jericho into your hands, along with its king and its fighting men.Joshua 5:13-6:2 (NIV)