All of the people who were in the city were called to pursue after them. As they pursued after Joshua, they were drawn away from the city.