They received divine help in fighting them, and the Hagrites and all their allies were handed over to them. They cried out to God during the battle; he responded to their prayers because they trusted in him.