 The late Middle Ages has often been seen as the era in which Scottish national identity was initially forged, in opposition to English attempts to annexe the country and as a result of social and cultural changes. English invasions and interference in Scotland have been judged to have created a sense of national unity and a hatred towards England which dominated Scottish foreign policy well into the 15th century, making it extremely difficult for Scottish kings like James III and James IV to pursue policies of peace towards their southern neighbour. In particular the Declaration of Arbroath asserted the ancient distinctiveness of Scotland in the face of English aggression, arguing that it was the role of the king to defend the independence of the community of Scotland. This document has been seen as the first "nationalist theory of sovereignty".
