Robert II inherited the throne from his uncle, David II, fairly late in life; as Robert the Steward, he spent most of his active years in virtual opposition to David, leading the Scottish nationalists against the invading armies of Edward III while David was in exile in France. Shortly after his accession Robert successfully concluded a treaty with Charles V (of France) that reaffirmed the Franco-Scottish alliance.