 Scotland in the Late Middle Ages , between the deaths of Alexander III in 1286 and James IV in 1513 , established its independence from England under figures including William Wallace in the late 13th century and Robert Bruce in the 14th century . In the 15th century under the Stewart Dynasty , despite a turbulent political history , the Crown gained greater political control over Scotland and Scotland's economy continued to expand . In the 17th century, Scotland was a semi-independent kingdom within the Kingdom of England . The Acts of Union 1707 was the first major political change, and the Crown gained greater political control over Scotland. kwietniki