All of the men of Ai were called out to chase them. They chased Joshua. So they were drawn away from the city.