after driving back the enemy he entrenched himself there together with his remaining troops