Yehoshua sent spies to scout out the city of Ai so that the Israelites could conquer it as God had instructed Yehoshua. However, the scouting mission was unsuccessful and the Israelites retreated from Ai, with no one knowing what had angered God. It was later discovered that a man named Achan had taken forbidden goods from Jericho, and he was put to death for his actions.