As Joshua withdrew from the armies of Israel, to meditate and pray for God's special presence to attend him, he saw a man of lofty stature, clad in warlike garments, with his sword drawn in his hand. Joshua did not recognize him as one of the armies of Israel, and yet he had no appearance of being an enemy. In his zeal he accosted him, and said, “Art thou for us, or for our adversaries? And He said, Nay; but as captain of the host of the Lord am I now come. And Joshua fell on his face to the earth, and did worship, and said unto Him, What saith my Lord unto His servant? And the Captain of the Lord's host said unto Joshua, Loose thy shoe from off thy foot; for the place whereon thou standest is holy. And Joshua did so.” SR 178.2
This was no common angel. It was the Lord Jesus Christ, He who had conducted the Hebrews through the wilderness, enshrouded in the pillar of fire by night and the pillar of cloud by day. The place was made sacred by His presence; therefore Joshua was commanded to put off his shoes. SR 178.3
The Lord then instructed Joshua what course to pursue in order to take Jericho. All the men of war should be commanded to compass the city once each day for six days, and on the seventh day they should go around Jericho seven times. SR 178.4