The marriage of James IV, King of Scots, and Margaret Tudor, the eldest daughter of Henry VII of England had been agreed in the Treaty of Perpetual Peace of 1502. This treaty was intended to effect a reconciliation between the kingdoms of Scotland and England which had been at war intermittently since 1296. The treaty would not be successful in establishing peace. Ten years after the marriage of James and Margaret Scotland and England aligned themselves with opposing alliances in the War of the League of Cambrai. The subsequent campaign ended with James' death in the Scots' defeat at Flodden.