All the troops with him marched until they were near the city. They camped north of Ai with the ravine between them and Ai.