During the Second War of Scottish Independence, Edward Balliol, son of King John Balliol, had invaded Scotland with the backing of Edward III of England, inflicting a defeat on the Scots at the Battle of Dupplin Moor. Douglas served under the dubious leadership of Patrick V, Earl of Dunbar leader of the second army that aimed to crush the smaller Balliol force. Following the rout of the Earl of Mar's force Dunbar did not engage the disinherited but retreated allowing Edward Balliol to be crowned at Scone. Following this battle, and as a sweetener to the English, Edward Baliol agreed to cede the county, town and castle of Berwick to England in perpetuity. However Douglas led a Bruce loyalist defeat on Balliol at the Battle of Annan, forcing him to flee back to England.