The early years of Stephen's reign were largely successful, despite a series of attacks on his possessions in England and Normandy by David I of Scotland, Welsh rebels, and the Empress Matilda's husband Geoffrey Plantagenet, Count of Anjou. In 1138, the Empress's half-brother Robert of Gloucester rebelled against Stephen, threatening civil war. Together with his close advisor, Waleran de Beaumont, Stephen took firm steps to defend his rule, including arresting a powerful family of bishops. When the Empress and Robert invaded in 1139, Stephen was unable to crush the revolt rapidly, and it took hold in the south-west of England. Captured at the battle of Lincoln in 1141, he was abandoned by many of his followers and lost control of Normandy. He was freed only after his wife and William of Ypres, one of his military commanders, captured Robert at the Rout of Winchester, but the war dragged on for many years with neither side able to win an advantage.