The Scots were defeated at Dunbar on 27 April 1296. John Balliol abdicated in Montrose castle on 10 July 1296. John was imprisoned in the Tower of London at first, but then released into the custody of Pope Boniface VIII on condition that he remain in a papal residence. He was later released around the summer of 1301 and lived the rest of his life on his family's estates in Picardy.