Before this miracle, Joshua commanded the people, “Shout! For the LORD has given you the town! Jericho and everything in it must be completely destroyed as an offering to the LORD. Only Rahab the prostitute and the others in her house will be spared, for she protected our spies.” Rahab was the person who hid the Israel spies so that the spies could return safely, and they promised to save Rahab and her household.
The spies returned, and told Joshua, “There’s no need for all of us to go up there; it won’t take more than two or three thousand men to attack Ai. Since there are so few of them, don’t make all our people struggle to go up there.” It was an excellent report. As expected, Ali was an easy one.
Then God said to Joshua, “Get up! Why are you lying on your face like this? Israel has sinned and broken my covenant! They have stolen some of the things that I commanded must be set apart for me. And they have not only stolen them but have lied about it and hidden the things among their own belongings. That is why the Israelites are running from their enemies in defeat. For now Israel itself has been set apart for destruction. I will not remain with you any longer unless you destroy the things among you that were set apart for destruction.”
So Joshua sent some men to make a search. They ran to the tent and found the stolen goods hidden there, just as Achan had said, with the silver buried beneath the rest. They took the things from the tent and brought them to Joshua and all the Israelites. Then they laid them on the ground in the presence of the LORD.