Matilda's position was transformed by her defeat at the Rout of Winchester. Her alliance with Henry of Blois proved short-lived and they soon fell out over political patronage and ecclesiastical policy; the Bishop transferred his support back to Stephen's cause. In response, in July Matilda and Robert of Gloucester besieged Henry of Blois in his episcopal castle at Winchester, using the royal castle in the city as the base for their operations. Stephen's wife, Queen Matilda, had kept his cause alive in the south-east of England, and the Queen, backed by her lieutenant William of Ypres and reinforced with fresh troops from London, took the opportunity to advance on Winchester. Their forces encircled Matilda's army. Matilda decided to escape from the city with Fitz Count and Reginald of Cornwall, while the rest of her army delayed the royal forces. In the subsequent battle the Empress's forces were defeated and Robert of Gloucester himself was taken prisoner during the retreat, although Matilda herself escaped, exhausted, to her fortress at Devizes.