The first war of independence began in the reign of King John Balliol. His short reign was bedeviled by Edward I's insistence on his overlordship of Scotland. The Scottish leadership concluded that only war could release the country from the English king's continued weakening of Balliol's sovereignty and so finalised a treaty of reciprocal assistance with France in October 1295. The Scots forayed into England in March 1296—this incursion together with the French treaty angered the English king and provoked an invasion of Scotland taking Berwick on 30 March before defeating the Scots army at Dunbar on 27 April. John Balliol submitted to Edward and resigned the throne to him before being sent to London as a prisoner. Despite this, resistance to the English led by William Wallace and Andrew Moray had emerged in the name of King John Balliol. On their deaths, Robert the Bruce continued to resist the English and eventually succeeded in defeating the forces of Edward II of England and gained the Scottish throne for himself.