Following the death of Margaret of Scotland in 1290, John Balliol was acompetitor for the Scottish crown in the so called 'Great Cause', as he was a great-great grandson of King David I through his mother (and therefore one generation further than his main rival Robert Bruce, 5th Lord of Annandale, grandfather of the future Robert the Bruce), being senior in genealogical primogeniture but not in proximity of blood. He submitted his claim to the Scottish auditors in an election overseen by [Edward I of England] at Berwick-upon-Tweed on 3 August 1291. The Scottish auditors' decision in favour of Balliol was pronounced in the Great Hall of the castle at Berwick on 17 November 1292 and he was inauguratedaccordingly king of Scotland at Scone, 30th November, 1292, St. Andrew's Day. Edward I then invaded, commencing the Wars of Scottish Independence. The Scots were defeated at Dunbar on 27 April 1296. John abdicated by a Deed signed in Montrose castle on 10 July 1296. Here the arms ofScotland were formally torn from John's surcoat, giving him the abiding name of "Toom Tabard" (empty coat). John was imprisoned in the Towerof London at first, but eventually 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 lifeon his family's ancestral estates in Picardy.