crowned king of Scotland in 1306. Victory at the Battle of Bannockburn in 1314 proved the Scots had regained control of their kingdom. In 1320 the world's first documented declaration of independence, the Declaration of Arbroath, won the support of Pope John XXII, leading to the legal recognition of Scottish sovereignty by the English Crown. A civil war between the Bruce dynasty and their long-term rivals of the House of Comyn and House of Balliol lasted until the middle of the 14th century. Although the Bruce faction was successful, David II's lack of an heir allowed his half-nephew Robert II, the Lord High Steward of Scotland, to come to the throne and establish the House of Stewart. The Stewarts ruled Scotland for the remainder of the Middle Ages. The country they ruled experienced greater prosperity from the end of the 14th century through the Scottish Renaissance to the Reformation, despite the effects of the Black Death in 1349 and increasing division between Highlands and Lowlands. Multiple truces reduced warfare on the southern border. Early modern period 16th century The Treaty of Perpetual Peace was signed in 1502 by James IV of Scotland and Henry VII of England. James married Henry's daughter, Margaret Tudor. James invaded England in support of France under the terms of the Auld Alliance and became the last British monarch to die in battle, at Flodden in 1513. In 1560, the Treaty of Edinburgh brought an end to the Anglo-French conflict and recognized the Protestant Elizabeth I as Queen of England. The Parliament of Scotland met and immediately adopted the Scots Confession, which signalled the Scottish Reformation's sharp break from papal authority and Roman Catholic teaching. The Catholic Mary, Queen of Scots was forced to abdicate in 1567. 17th century In 1603, James VI, King of Scots inherited the thrones of the Kingdom of England and the Kingdom of Ireland in the Union of the Crowns, and moved to London. The first Union Jack was designed at James's behest, to be flown in addition to the St Andrew's Cross on Scots vessels at sea. James VI and I intended to create a single kingdom of Great Britain, but was thwarted in his attempt to do so by the Parliament of England, which supported the wrecking proposal that a full legal union be sought instead, a proposal to which the Scots Parliament would not assent, causing the king