During David's minority, Sir Thomas Randolph, 1st Earl of Moray, was appointed Guardian of Scotland by the Act of Settlement of 1318. After Moray's death, on 20 July 1332, he was replaced by Donald, Earl of Mar, elected by an assembly of the magnates of Scotland at Perth, 2 August 1332. Only ten days later Mar fell at the Battle of Dupplin Moor. Sir Andrew Murray of Bothwell, who was married to Christian (or Christina), the sister of King Robert I, was chosen as the new Guardian. He was taken prisoner by the English at Roxburgh in April 1333 and was thence replaced as Guardian by Archibald Douglas (the Tyneman), who fell at the Battle of Halidon Hill that July.